Your company data could not be compacted successfully" in Sage 50
Sage 50 tried to shrink your company file and stopped partway, usually because the data has damage that blocks the compaction process.
You asked Sage 50 to compact your company file, and it gave up partway through. The message “Your company data could not be compacted successfully” means the compaction routine ran, hit something it could not process, and aborted. Your data is normally still there, but the file has not been shrunk, and whatever blocked the compaction is still inside the file.
Compaction (Sage 50 also calls it file maintenance) rewrites the database to reclaim space left behind by deleted records. To do that safely, it has to read and rewrite every part of the file. If any record, index, or link is damaged, the routine stops rather than risk producing a half-rewritten file. That is why this message usually points to underlying data damage, not to a compaction setting you got wrong.
Is your data safe right now?
In most cases the original data survives, because the routine abandons the rewrite when it fails. That is the design intent, but do not rely on it. Make a fresh copy of the company file, or a full backup, before you try anything else. Work on the copy, not the live file.
Run a data integrity check first
Before retrying compaction, run Sage 50’s data integrity check on the file. It reports whether the books balance internally and whether the database structure is consistent. If it reports errors, that is your answer: the compaction is failing because the file is damaged, and repeating the compaction will keep failing. If it comes back clean, the problem may be environmental instead, such as the file being on an unreliable network share or a disk with errors.
Rule out the simple causes
A few non-damage causes are worth ruling out. Make sure you are the only user, with everyone else logged out of the company, and that no one has the file open through a shared folder. Run the compaction on the machine that physically holds the file rather than across the network. Check that you have ample free disk space, since compaction needs room to build the rewritten file. Then try once more. If it fails again on a clean integrity check, stop retrying; repeated attempts on a fragile file add risk without adding information.
Restore from a backup
If you have a backup from before the file started misbehaving, restoring it is the safest route back to a working company. You lose whatever was entered since the backup, so weigh that against how badly you need the compaction. A restored file that compacts cleanly confirms the damage was in the newer copy.
When the file needs professional attention
If the integrity check fails, or the compaction keeps failing with no backup to fall back on, the file needs repair rather than another retry. Our engineers repair damaged Sage 50 and Simply Accounting databases directly, fixing the structural damage so maintenance routines can complete again. You can send us the file for a free evaluation of your damaged Sage 50 database, and we will tell you what is wrong and what recovery would involve before you commit to anything.
If your real goal was shrinking the file before a move to QuickBooks, note that a conversion does not require a successful compaction, and a damaged file can often still be converted. See our Sage 50 to QuickBooks conversion service for how that works and what carries over.