diff --git a/config/software/gitlab-rails.rb b/config/software/gitlab-rails.rb
index 78d3ffb1e872daf14e6837945258b619d4787044_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1yYWlscy5yYg==..97fb12b4ebd0dc78f5ae1b7b30e03e727f6e954b_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1yYWlscy5yYg== 100644
--- a/config/software/gitlab-rails.rb
+++ b/config/software/gitlab-rails.rb
@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+require 'yaml'
 require "#{Omnibus::Config.project_root}/lib/gitlab/version"
 require "#{Omnibus::Config.project_root}/lib/gitlab/ohai_helper.rb"
 
@@ -135,6 +136,5 @@
   # In order to compile the assets, we need to get to a state where rake can
   # load the Rails environment.
   copy 'config/gitlab.yml.example', 'config/gitlab.yml'
-  copy 'config/database.yml.postgresql', 'config/database.yml'
   copy 'config/secrets.yml.example', 'config/secrets.yml'
 
@@ -139,5 +139,12 @@
   copy 'config/secrets.yml.example', 'config/secrets.yml'
 
+  block 'render database.yml' do
+    database_yml = YAML.safe_load(File.read("#{Omnibus::Config.source_dir}/gitlab-rails/config/database.yml.postgresql"))
+    database_yml.each { |_, databases| databases.delete('geo') unless EE }
+
+    File.write("#{Omnibus::Config.source_dir}/gitlab-rails/config/database.yml", YAML.dump(database_yml))
+  end
+
   # Copy asset cache and node modules from cache location to source directory
   move "#{Omnibus::Config.project_root}/assets_cache", "#{Omnibus::Config.source_dir}/gitlab-rails/tmp/cache"
   move "#{Omnibus::Config.project_root}/node_modules", "#{Omnibus::Config.source_dir}/gitlab-rails"