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 231847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:58:03+00:00 2026-05-11T19:58:03+00:00

I have a test server that uses data from a test database. When I’m

  • 0

I have a test server that uses data from a test database. When I’m done testing, it gets moved to the live database.

The problem is, I have other projects that rely on the data now in production, so I have to run a script that grabs the data from the tables I need, deletes the data in the test DB and inserts the data from the live DB.

I have been trying to figure out a way to improve this model. The problem isn’t so much in the migration, since the data only gets updated once or twice a week (without any action on my part). The problem is having the migration take place only when it needs to. I would like to have my migration script include a quick check against the live tables and the test tables and, if need be, make the move. If there haven’t been updates, the script quits.

This way, I can include the update script in my other scripts and not have to worry if the data is in sync.

I can’t use time stamps. For one, I have no control over the tables on the live side once it goes live, and also because it seems a bit silly to bulk up the tables more for conviencience.

I tried doing a “SHOW TABLE STATUS FROM livedb” but because the tables are all InnoDB, there is no “Update Time”, plus, it appears that the “Create Time” was this morning, leading me to believe that the database is backed up and re-created daily.

Is there any other property in the table that would show which of the two is newer? A “Newest Row Date” perhaps?

  • 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-05-11T19:58:03+00:00Added an answer on May 11, 2026 at 7:58 pm

    In short: Make the development-live updating first-class in your application. Instead of depending on the database engine to supply you with the necessary information to enable you to make a decision (to update or not to update … that is the question), just implement it as part of your application. Otherwise, you’re trying to fit a round peg into a square hole.

    Without knowing what your data model is, and without understanding at all what your synchronization model is, you have a few options:

    1. Match primary keys against live database vs. the test database. When test > live IDs, do an update.
    2. Use timestamps in a table to determine if it needs to be updated
    3. Use the md5 hash of a database table and modification date (UTC) to determine if a table has changed.

    Long story short: Database synchronization is very hard. Implement a solution which is specific to your application. There is no “generic” solution which will work ideally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 153k
  • Answers 153k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The message encoding specified by the binding will determine how… May 12, 2026 at 10:24 am
  • Editorial Team
    Editorial Team added an answer I suggest that you take one of the existing style-sheets,… May 12, 2026 at 10:24 am
  • Editorial Team
    Editorial Team added an answer What you should do is write a streambuf which uses… May 12, 2026 at 10:24 am

Related Questions

I have a test server that uses data from a test database. When I'm
I've inherited a BizTalk 2006 application that uses several SOAP ports to request data
I have a data-source connected to a stored proc that will return the one
I ran across a new problem in the last week. Due to the nature
Hopefully someone can shed a little light on an issue that I'm currently having

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.