Op donderdag 6 december 2018 10:54:27 CET schreef David C. Rankin:
On 12/5/2018 3:22 PM, Andrei Verovski wrote:
Hi !
I have an old accounting system running on SuSE 42.x and MySQL 5.6.
Can I just copy all mysql files from /etc and /var/lib/mysql to another PC with Leap 15 and MySQL 5.6 ?
This MySQL DB have a truckload of tables and developer of the software doesn't offer much help right now.
Thanks in advance.
Short answer -- yes you can -- but, there is a better way. Simply use `mysqldump` to dump all tables in the database to a bz2 file and then move the bz2 file the new computer and import the database there.
For example to completely move your "toys" database (example name) you wold
$ mysqldump toys | bzip2 -c > toysbackup.bz2
The move toysbackup.bz2 to your new machine and to restore it, simply do
$ mysql toys < <(bzcat toysbackup.bz2)
Done. This way mysql can catch and handle any table version differences as part of the import rather than trying to sort out table versions in raw /var/lib/mysql files. I did copy /var/lib/mysql files a couple of time during the SuSE 7 days, but since, I just dump to bz2 or xz and move the compressed archive of all tables and the import on the next machine. Another option is to install and use phpmyadmin on both machines. Export the databases on machine 1 to .sql files, import them on machine 2.
-- Gertjan Lettink a.k.a. Knurpht openSUSE Board Member openSUSE Forums Team -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org