Help for owners
Every database change is a gamble and has broken my live app
Short answer
Changes made by hand on the live database are not recorded, not tested and cannot be undone, so the app and the data can fall out of step. The safe method keeps each change as a small, versioned script, tries it on a copy of real data first, takes a backup before running it and has a way back.
Does this sound like your situation?
- After a release the app shows errors until someone fixes a table by hand.
- The test version and the live version of the database are different.
- Developers are afraid to touch the database.
- Nobody has a record of what changed in the database and when.
- A change once deleted or damaged data.
Why does this happen?
Changes are typed directly into the live database
A developer logs in and edits tables by hand. It works once, but it leaves no record and cannot be repeated on another copy.
Code and database are released separately
If the new code goes live before the database has the new column, or the other way round, the app fails in between.
Test data does not look like real data
A change that works on a small clean test copy can fail on the real one, where there are old rows, blanks and odd values.
Large tables lock while changing
Some changes make a big table unusable for a while, so the app appears down. This needs planning, not just a command.
There is no way back
Without a recent backup and a tested undo step, a failed change becomes a data loss problem.
What can I do about it today?
- Confirm backups exist and workAsk when the last backup was taken, where it is stored and whether anyone has ever restored from it on a test machine.
- Ask for no hand edits on the live databaseUntil a process exists, ask that every change is written down first and reviewed by a second person.
- Ask for the changes to be recordedAsk your developer to keep a list of every database change made from now on, with the date and the reason.
- Schedule changes for a quiet hourAsk that changes happen when few customers are on the system, and that someone is available to watch.
- Do not run any commands yourselfIf you have database access, leave it untouched. Incorrect commands on a live database can be impossible to reverse.
When should I bring someone in?
- A past change lost or damaged data and you have not confirmed what is missing.
- You have no tested backup.
- A large change is planned, such as a new structure for customers or orders.
How do I handle it?
- Read the current structureI document the tables as they are today and compare the test and live versions to find differences.
- Turn changes into versioned scriptsEach change becomes a small script kept with the code and run in order, so every environment gets the same changes.
- Rehearse on a copy of real dataThe script runs first on a copy, with timing and results recorded.
- Back up, then run, then checkA backup is taken immediately before the live change, and the result is checked against agreed counts and screens.
- Keep a way backEvery change has a tested reverse step or a restore plan, written before it runs.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
What is a database migration?
A small recorded script that changes the database structure in a repeatable way, so every copy of the database can be brought to the same state.
Will a migration process cause downtime?
It can if a change locks a large table. Planning the change, and choosing a quiet time, reduces or avoids it, but it depends on the change.
Do I need a new database?
Usually not. The existing database can be put under a controlled change process.
How was this page made?
I drafted this page with AI assistance. It is general guidance for business owners, not advice for your own system. Found a mistake? Tell me.