MySQL Forums
Forum List  »  Backup

Re: Moving dbs to new server
Posted by: Rick James
Date: April 01, 2012 11:32PM

> Question: Is there a problem if you just more or less cut and paste/copy the existing files from the data directory on the old server into the data directory on the new machine? What restrictions apply to doing something like this.

That works fine if the MySQL versions are identical. It will probably work if it is the same sub-version (eg, 5.1.xx -> 5.1.yy), but it unlikely to work without some extra futzing is a more significant version change.

Take the entire data/ directory. Also copy my.cnf (my.ini), but re-tune it if the hardware is beefier:
http://mysql.rjweb.org/doc.php/memory

Install MySQL on the new machine; stop mysqld on both the new and old machines; then copy. After the copy, it should start up.

(This method works for both MyISAM and InnoDB, and is especially useful in creating a new Slave from an old one.)

Options: ReplyQuote


Subject
Views
Written By
Posted
3041
March 31, 2012 05:25PM
Re: Moving dbs to new server
1389
April 01, 2012 11:32PM
1396
April 02, 2012 08:32AM
1437
April 03, 2012 09:15AM
1698
April 03, 2012 12:17PM
1358
April 04, 2012 09:00AM
1309
April 05, 2012 02:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.