Chapter 6: Data backup, repair, recovery Up Part II: Advanced MySQL Administration and Management Chapter 8: Odds and Ends 

7 Migrating a SiteWorx account to a different MySQL server

When using MySQL remote servers, or additionally when your server scales to the point that your MySQL server is becoming overwhelmed by some of the larger, busier clients, you may elect to move some SiteWorx accounts around. This is generally not recommended because of possible discrepancies between MySQL versions, and other possible “issues” that crop up when you are moving MySQL data around willy-nilly. Yet when push comes to shove, it is possible to move a SiteWorx account’s MySQL data and re-map that account to another MySQL server.
Using ~iworx/bin/iworxdb-transfer.pex, you can migrate the data AND re-map a SiteWorx account’s assigned database. You need to specify at minimum a SiteWorx account (by master domain name) and a new server nickname (as discussed in section 3.2↑) to migrate MySQL data to and re-assign the account. The options available for the script are as follows:
--domain=[SiteWorx domain] sets the SiteWorx domain that is going to have data transferred and it’s MySQL server moved.
--new-server-nickname=[MySQL server nick] is the new MySQL server nickname to move the SiteWorx account to. You are to refer to the MySQL server’s nickname as shown in NodeWorx under System Services ▷ MySQL Server ▷ Remote Servers.
--force will drop (i.e. delete) any databases/tables that exist on the target new MySQL server if they match in name before migrating data over. This option should be used with care. Ensure that there aren’t going to be any collisions of databases or tables prior to attempting the migration.
--dont-transfer-data will not perform any data transfer, it will just do a remapping of the SiteWorx account’s assigned MySQL server. Thus, databases and users will disappear from that SiteWorx account until they are moved over manually.
For example,
~iworx/bin/iworxdb-transfer.pex \
will transfer a SiteWorx account with master domain back to the localhost MySQL server. You can also add --dont-transfer-data to this command, and move the data/users manually using the backup techniques discussed in section 6.2.2↑, followed with an import in phpMyAdmin (once users are created), or an import from command-line using the mysql command-line client. An import with the command-line mysql client would look like:
# mysql -S /var/lib/mysql/mysql.sock -u [SiteWorx MySQL Database User] -p
Enter password: **********
mysql> source /path/to/mysqldump.sql
 Chapter 6: Data backup, repair, recovery Up Part II: Advanced MySQL Administration and Management Chapter 8: Odds and Ends 

(C) 2019 by InterWorx LLC