Hello/Hi/Greetings,
I need to move my piwigo install from a kimsufi server to a hosted site (o2switch right now). No major problem.
However, I tend to like better use the local automatic install system that may better fit the local config, so on my new web site piwigo was installed by softaculous.
My old install was managed by myself, and mysql (mariadb) managed with command line.
So the old tables and the new ones don't have the same prefix
So I'm not sure how I can manage the database move.
I usually get the table backup with this:
http://dodin.info/wiki/pmwiki.php?n=Doc … 2017#toc12
mysqldump --opt -u root -p BASE TABLE > xxx.sql
Can I change the table prefix in the sql file (with search/replace), or is there some way to do this with sql commands (or other way like sed or awk). I have phpmyadmin on the new install (but not on the old one).
thanks
jdd
Last edited by jdd (2017-04-12 18:22:31)
Offline
I found several solutions, but couldn't yet test them...
* on the receiving side, either keep the same prefix as was and change the prefix in
~/public_html/piwigo/local/config/database.inc.php
line
$prefixeTable = 'piwihb_';
* still on the receiving side, go to phpmyadmin, import the backup, then select the base, select the piwigo tables (if there are no other, go to the bottom and select all), then "with selected" "replace name prefix".
* with vi or any decent editor (kwrite should work) make a search/replace. Probably better do it manually, there are not so many tables, to prevent changing a string inside a text
jdd
Offline
Finally the easiest way was to move by CLI and change name in piwigo or with phpmyadmin.
The database backup (mysqldump) is more than 800Mb large, and the backup with phpmyadmin on the source didn't give a usable sql (refused on target), when mysql dump works.
phpmyadmin is much better to remove unuseful tables or rename them, but dump and restore is best with phpmyadmin...
new install on temporary domain
http://dodin.xyz/wiki/pmwiki.php
jdd
Offline