Difference between revisions of "MySQL/migration"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m
m (Woozle moved page MySQL/porting/data to MySQL/migration without leaving a redirect: reorganizing)
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Techniques]]
+
==About==
K, here's how I do it:
+
This subpage is about migrating data between [[MySQL]] databases, i.e. backing up data to independent files, and restoring the data from those files back into a database
==Backing up==
+
 
#Make sure you've got [http://www.phpmyadmin.net PHPMyAdmin] running
+
There is a choice of tools for doing this.
and that's all happy. I won't cover this part here as it varies with
+
* [[Beekeeper Studio]], but only the paid versions
your set up.
+
* [[mysqldump]] (command-line)
#Login and choose '''Export''' from the main page
+
* [[MySQL Workbench]] (GUI utility)
#Leave most of the default options. Specifically,
+
* [[PHPMyAdmin]] (web-based)
#*Format: SQL
+
* '''obsolete''':
#*Select the database(s) you want in the listbox
+
** [[MySQL Admin]] (GUI utility) - this has been replaced by [[MySQL Workbench]]
#*etc.
+
==Related Resources==
#Checkmark 'Add DROP TABLE'. This will make sure that when you restore
+
* [https://sourceforge.net/projects/automysqlbackup/ AutoMySQLBackup] ([https://web.archive.org/web/20081218005549/http://members.lycos.co.uk/wipe_out/automysqlbackup/ origin story])
from a backup, it will delete existing tables before restoring from the
 
backed up ones.
 
#Checkmark 'Save to file' at the bottom, or it will just dump it to
 
your browser window, and that's no fun.
 
#*You probably also want to use compression. These won't be huge files,
 
but a 1.5mb database compresses to about 150kb. So, y'know, whatever.
 
Wiggy recommends BZIP.
 
#Click '''Go'''.
 
==Restoring from backup==
 
''I'm writing this from memory, so I might be wrong, but I '''think'''
 
it's right.''
 
#Click '''Databases''' from the PHPMyAdmin main page
 
#Click the name of your databse (it should already exist; have you
 
[re]installed [http://www.mediawiki.org MediaWiki] yet? Do that first.)
 
#Click the '''SQL''' tab
 
#Where it says '''Location of textfile:''', browse to your latest
 
backup, then click '''Go'''.
 
Good luck :E
 

Latest revision as of 16:33, 4 November 2024

About

This subpage is about migrating data between MySQL databases, i.e. backing up data to independent files, and restoring the data from those files back into a database

There is a choice of tools for doing this.

Related Resources