Question

I have a MySQL database that I want to archive. What is the best way to do this?

Note: I don't want to just do a backup. I want to do a one time export of the data for long term storage in a way that I can get at on a later date. Particularly, I want to not be tied to MySQL, a database or preferably any given software (I'd really like it to be trivial to wright a program that can read it back in, something like a few dozen lines of C or perl).

My current plan is to dump stuff to a table using the CSV engine and then burn that to DVD. The is nice because CSV can be loaded by so many different programs. The only gotcha in this is that the bulk of the data is in Blob columns as in binary so I'll need to decode how that is encoded.

Was it helpful?

Solution

Exporting to CSV, encoding binary data with Base64 encoding, and then compressing with gzip sounds like a good way to go. I'd advise you to think well about your choice of DVDs though. Recordable media tends to deteriorate rapidly over the years.

OTHER TIPS

You could dump the entire DB into a .sql file and use a VCS to archive each version. If you needed an old version, you could export it out of the repository and restore from it.

mysql> ALTER TABLE arch2 ENGINE='ARCHIVE';

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top