Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7773557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:09:33+00:00 2026-06-01T17:09:33+00:00

I have two servers: production and testing. Both of them run PostgreSQL. I made

  • 0

I have two servers: production and testing. Both of them run PostgreSQL. I made a lot of alterations on testing server, like ALTER table, CREATE INDEX etc. and want to transfer these alterations to the production server as easy as possible. What is the most convenient way for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:09:34+00:00Added an answer on June 1, 2026 at 5:09 pm

    The best way to do this would be:

    1. Run pgdump on each database, creating a full dump.
    2. Use a comparison tool like Beyond Compare to run through the two files side by side and create a merge; given that you’ve said there are only ‘alter’ changes and data changes the two should be similar enough that it can line them up
    3. Create a new test DB to deploy that script to, and run the script via psql (or whatever tool you use.)
    4. If that script runs successfully, wipe out the target DB and run that script against it.
    5. Make sure the application(s) that the DB backs are put offline during this process, at least during the time when you drop the DB and redeploy.
    6. If there are additional data changes, you may wish to pgdump the target DB before dropping it. You can then merge back in the data added during the time between the first pgdump on the target DB and the second one.

    Other notes:

    • Pgdump is a command line tool, usually run via ssh (like PuTTY)
    • It outputs ASCII text SQL scripts in proper creation order, since PostGre can have object interdependencies.
    • psql, the command line interface to PostGre should allow you to execute a script from file, if you don’t have a GUI program that can handle a SQL script as large as your entire dump.
    • There are options to dump data and structure separately.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two servers where I installed SQL Server 2008 Production: RAID 1 on
The setup: 2 web servers and a seperate state server I have two production
I have a setup with two servers (staging and production). Both of these has
Let's say I have two database instances: InstanceA - Production server InstanceB - Test
You have two servers when you perform a SQL Server database mirroring You have
I have two servers: Fedora running Apache/2.2.14 (old server) CentOs running Apache/2.2.3 (new server)
I have two dedicated servers and no hardware firewall. I'd like to forward all
I have two grails servers: Server - has read/write access to the database Web
I have two MySQL databases: one for testing, and one for production. They are
I have two SQL Servers, one for production, and one as an archive. Every

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.