InterWorx to cPanel Migrations Tutorial

InterWorx to cPanel Migrations Tutorial

With unlimited site hosting per license and solid core features, SMB customers who don’t use any cPanel-specific features could save big money by switching to InterWorx. There could also be cases, though, where migrating from InterWorx to cPanel is mandatory to consolidate services, add a cPanel-specific feature, or integrate two businesses using different panels.

While InterWorx has an import feature that can take backups from cPanel servers and restore them as valid InterWorx accounts, making migrations to the platform simpler, the reverse just isn’t true. Migrations from InterWorx to cPanel will should be performed manually.

With the appropriate general knowledge and specific details about your server usage, this sort of migration may be executed in a number of hours for a small number of web sites.

Considerations Before Starting

While there are a number of blockers in moving from cPanel to InterWorx, these particular blockers are only in a single direction. As an example, InterWorx requires database prefixing in all cases to map databases to their owners, but cPanel doesn’t. So, there mustn’t be a case where a database name will cause an import to fail.

One vital thing to recollect about cPanel is its licensing costs. InterWorx allows for an infinite variety of SiteWorx accounts per server, but cPanel costs will change depending on what number of cPanel accounts you might want to create. 

Things you will have to think about before moving from InterWorx to cPanel:

  • What’s going to your final price can be for the content you might want to host?
  • What’s the forecasted growth for your corporation, and the way much space and power will your server require?
  • Do you’ve gotten the appropriate licenses and software to support your goals?

One other consideration is server clustering. Out of the box, InterWorx can support multiple web nodes working in unison to balance traffic. cPanel doesn’t support this by default, and extra products can be needed in the event you use this feature. 

So far as general server migration considerations go, it’s best to have a very good understanding of where the DNS on your domains is hosted (your nameservers). On the conclusion of your migration, you will have to make changes to the DNS to make the brand new server live, and ensuring access to your nameservers early in the method makes the ultimate turnaround faster.

If possible, lower the TTL values in your records now in order that once we take the brand new server live, propagation will occur quickly.

Moreover, pay attention to the features that you just use in your server. In the event you host mail, be sure your mail accounts, together with their passwords and mailbox contents, are copied in the course of the migration and that any in-use mail ports are opened and arrange on the brand new server. In the event you use Redis, Memcache, or every other third party applications, be sure those are arrange on the cPanel machine ahead of time as well.

There just isn’t much to be done in InterWorx, specifically to prepare on your migration. Usually, you’ll want to make sure that updates to your sites (latest posts, product releases, etc.) are temporarily suspended to lower the probabilities of lost data and that your sites are on up-to-date core software, comparable to PHP 7 or greater.

1. Creating cPanel Accounts

Now, we are able to finally get to work on migrating! First, assemble a listing of the entire SiteWorx accounts in your server that you just want to migrate. As root on the InterWorx server, you should use this command to accomplish that:

nodeworx -u -c Users --action listUsers -n

You’ll be able to relate these to hosted domains using this command, also run on the InterWorx machine:

nodeworx -u -c Siteworx -a listDomainAccounts -n |tr "t" "|" |awk -F"|" '{print $10,$2,$11,$19,$22}' |column -t

This could print out the domain name, username, whether it’s a primary or secondary domain, its PHP version, and the situation of the document root for the location.

Make Users

cPanel accounts may be created through the WHM interface or as root from the command line on the cPanel server:

/scripts/createacct yourdomain.com youruser EB-al2pK)*o=

In the event you occur to know the passwords for your whole SiteWorx users, you would enter them above. Random passwords will work here in the event that they are suitably secure, and users can reset them after the migration is complete. You can too copy the password hashes directly from /etc/shadow into the brand new server in the event you are comfortable doing so.

Note:

No matter the way you migrate your passwords, it’s highly beneficial that users change their password after the migration is complete. Passwords which are typed plaintext into the command line can be saved in bash history and might be exposed by root level users. Even in the event you import hashes directly, it’s a very good security practice to alter your passwords every few months.

Make Mailboxes

With the accounts, it’s best to also create mailboxes that belong to every account. This will, again, be done through the cPanel web GUI or from the command line.

Run this command on the cPanel server so as to add a mailbox:

/scripts/addpop [email protected] /tQ7biFJ]24%

Note:

There are some special characters like , |, or !, that can cause odd behavior within the command line when utilized in a password. In the event you get odd output from the createacct or addpop commands, try using a unique random password.

The passwords for mailboxes may be entered, if known, or updated later in /home/youruser/etc/yourdomain.com/shadow files on the cPanel server. The unique mailbox password hashes may be pulled using this command on InterWorx:

mysql -Ns -u iworx_vpopmail -p$(grep mysqli://iworx_vpopmail: /home/interworx/iworx.ini | cut -d: -f3 | cut -d@ -f1) -S /usr/local/interworx/mysql/iworx-db.sock iworx_vpopmail -e "select pw_passwd from vpopmail where pw_name='user' and pw_domain='yourdomain.com'"

Above, you’ll replace the user and yourdomain.com near the tip of the command with the actual mailbox and domain name to get the hash for that user. Again, it’s best to only do that in the event you are comfortable with editing the shadow files on your mailboxes; otherwise, it is simpler to easily let the users reset their mail passwords once the migration is complete.

Make Databases

Going off of a listing of databases from the source server, which you’ll get from listing the /var/lib/mysql directory and on the lookout for user-prefixed folders, generate databases individually using this command on the cPanel server:

mysqladmin create youruser_dbname

After creating the databases, you will have so as to add users as well. This command, run on the InterWorx server, gets the database users which have access to the database you specify and makes a grant command that you may paste into your cPanel machine’s terminal. Make sure to change youruser_dbname initially of the command to the database you might be working on whenever you run this on the InterWorx server:

mydb=youruser_dbname; mysql -BNe "select user from mysql.db where db='"$mydb"' and host='localhost'" | while read i; do pwhash=$(mysql -BNe "select Password from mysql.user where Host='localhost' and User='"$i"';"); echo "mysql -e 'grant all privileges on $mydb.* to $i@localhost identified by password "$pwhash"'"; done

Paste the output into your cPanel server to grant access. 

Finally, we’d like to map the database and latest user in order that it might probably be controlled from the appropriate account. Use this command on cPanel, replacing the entire yourxxxx portions as needed:

/usr/local/cpanel/bin/dbmaptool youruser --type mysql --dbs 'youruser_dbname' --dbusers 'youruser_dbuser'

2. Copying Files

Now that we now have a spot on the cPanel server for all of our site files, emails, and databases to land, we are able to begin copying them over. The entire sample commands below are run on the cPanel server and can should be updated with the suitable IP address of the InterWorx machine. This step is greatly simplified in the event you add an SSH key from the cPanel server into the InterWorx server for passwordless root-level SSH access.

Note:

In case your InterWorx server just isn’t using port 22 for SSH, you will have so as to add the next bit (with the right SSH port) to your rsync commands together with the remainder of the flags: -e ‘ssh -p9898’

Document Roots

The person domain information we discovered initially of the migration process can be very handy here. Match up logically the entire accounts you created to the accounts in InterWorx. For our examples, we are going to assume that the cPanel username is similar because the InterWorx username and that each account only controls one domain.

This command to repeat a primary domain document root from InterWorx to cPanel is run on the cPanel server:

rsync -avHP 123.45.67.89:/home/youruser/public_html /home/youruser/

Make sure to watch the trailing slashes! This command copies public_html and its contents from the distant InterWorx machine into the /home/youruser/ folder on the local cPanel machine.

If there are additional document roots to repeat into additional separate folders, you should use similar commands with the correct goal folder.

Emails

Emails are copied using an rsync command as well since they’re stored in the same folder-based format on each systems. Here is the command for the sample email address we created earlier, which can be run from the cPanel server:

rsync -avHP 123.45.67.89:/home/youruser/var/yourdomain.com/mail/user/Maildir/ /home/youruser/mail/yourdomain.com/user/

There are plenty of unique items that should be altered throughout this command based on the account, mail user, and domain you might be syncing data for, including youruser (the cPanel/InterWorx account name), yourdomain.com, and user (the mailbox name).

Databases

Databases may be streamed from the InterWorx server over to the cPanel server directly using a straightforward pipeline. This avoids having to generate a file-based dump after which copying and reading that file. Our same sample database is copied here, and this command is run on the cPanel machine:

ssh 123.45.67.89 "mysqldump youruser_dbname" | mysql youruser_dbname

Additional Items

There are a number of miscellaneous files that may also be copied to create a more complete clone of the InterWorx accounts. Specifically, the crontab may be read from /var/spool/cron/youruser and its contents inserted into the identical file on the cPanel server. Just make sure that you aren’t going to prematurely run any crons that would double-bill your eCommerce sites or duplicate other functions which are still being performed by your old machine.

This can be a fantastic time to double-check and arrange any programs from the source machine that you prefer to to proceed using like ElasticSearch, NGINX, ImageMagick, and so forth, in the event you didn’t accomplish that before starting the transfer. It is best to also set any configuration limits that you just modified to permit your sites and server to work together higher comparable to those in PHP/Apache or CSF; nevertheless, a brand new server can be cause for a latest tuning session.

3. Testing Migrated Sites

If you finish the entire above steps, you’ll give you the chance to check the sites on the brand new server. Start by changing the hosts file. Hosts file editing is a far more accurate method than every other available option. Start by making a line of text like this one with the IP of the brand new server then a listing of domains and subdomains you should test, separated by spaces:

11.22.33.44 yourdomain.com www.yourdomain.com

Add that line to the tip of the hosts file in your workstation (not either server). You’ll be able to then test the location by visiting it in your browser normally, without having to alter public DNS or use a less accurate proxy service. 

While testing the brand new server, you generally wish to make sure that sites aren’t missing any images or CSS files or giving every other glaring errors. Troubleshoot as needed to correct these before going live.

4. Going Live

To shift traffic from the old server to your latest one, the one remaining step is a DNS update of the entire records which are referencing the old IP. There is generally a single A record that points to the IP address of the source server (123.45.67.89 in our example), which can should be modified to the brand new IP.

There are numerous options for where your DNS is controlled. You would possibly currently use Liquid Web’s shared nameservers, by which case, you may change your DNS at My LiquidWeb or by sending us a support ticket. 

You may additionally have DNS at your registrar or at CloudFlare. In that case, you’ll do the identical IP address change but at the suitable control panel for that nameserver.

The opposite possibility is that you just control DNS on InterWorx itself with custom nameservers. The menu you wish may be accessed from NodeWorx  >   System Services  >   DNS Server  >   Zones.

Note:

In the event you fall into this category, the Nameserver Glue records at your nameserver’s most important domain’s registrar may also should be modified. Otherwise, DNS will proceed to be served by InterWorx, and terminating that server would take your sites offline. Any registrar should give you the chance to guide you on glue record changes in order that DNS may also be shifted to cPanel when the migration is finished.

Changing the IP addresses will make your latest server live, and your migration is now complete. 

Traffic should start flowing to the brand new server because the TTL value in your DNS slowly expires. This is the reason lowering the TTL value is essential to do initially of your migration.

Liquid Web Knows Migrations

If this guide sounds a bit too intense, don’t worry. We have now a dedicated Migrations Team available to assist all of our Fully Managed customers, with many years of experience successfully migrating web sites into cPanel environments. Reach out to the Support Team 24/7 through My LiquidWeb to get more information today.

Datasheet - Migration Checklist