Skip to main content

Migrating to and from TangibleXP

Tangible offers one free migration per LMS application. If you're creating a new application on TangibleXP, get in touch with our team for support.

Although it is possible to migrate a WordPress site to TangibleXP using simple methods such as a migration plugin, doing this may overwrite the bespoke configuration and optimization plugins that Tangible includes with every new application. For that reason, and to avoid migration glitches that sometimes occur when moving large sites with a migration plugin, we recommend manually migrating the database and files as described below.

  1. Create a new TangibleXP site
  2. Backup the site's database as a .sql file, either via PHPMyAdmin or using the wp db export command
    wp db export database.sql
    If WP-CLI is not available on the source server, try using the PHPMyAdmin export tool. Be sure to select the main WP database, then select the "Custom" export method. Toggle on the Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement option, then export. The Custom export method in the PHPMyAdmin GUIThe DROP TABLE option in the PHPMyAdmin GUI
  3. Download the site's wp-content folder. Alternatively, use a tool like rsync to move the files directly between the servers.
  4. Overwrite the wp-content/plugins, wp-content/themes, wp-content/uploads, wp-content/languages directories in the TXP install with the ones from your old site.
  5. Upload your DB backup file to the new site, then import it via CLI using the wp db import command
    wp db import /path/to/database.sql
  6. Deactivate any caching, SMTP plugins, or migration plugins on the site you're migrating
  7. Activate Surge and Tangible Object Caching

Performing a Search & Replace

To search and replace the site's domain within your database dump, run this command on the SQL file before import:

sed -i 's,//olddomain.com,//newdomain.com,g' database.sql
info

Note that you can use any character as a delimiter when using the sed command. While forward slashes are commonly used, we are replacing them with a comma in this case because the old/new text both contain forward slashes.

If you want to import your SQL file directly using the mysql command, you will also need to search and replace the database name and database user. This is because your mysql user on TXP (with the username "wordpress") will only have permission to write to the database named "wordpress". Here are the commands you can run on your SQL file before import to accomplish that:

sed -i 's/old_database_name/wordpress/g' database.sql
sed -i 's/old-username/wordpress/g' database.sql

Updating your database export prefixes

TXP uses the wp_ prefix by default. If you'd like to adjust your database.sql file to use the default prefix, you can run these commands from the directory your .sql file is in:

sed --in-place --expression 's#`old-prefix_#`wp_#g' database.sql
sed --in-place --expression 's#'old-prefix_user_roles#'wp_user_roles#g' database.sql
sed --in-place --expression 's#'old-prefix_capabilities#'wp_capabilities#g' database.sql
sed --in-place --expression 's#'old-prefix_user_level#'wp_user_level#g' database.sql

If you'd rather retain your old DB prefix, update the $table_prefix = 'wp_'; value in the /app/www/wp-config.php file

Using rsync

rsync is a CLI tool for copying files. Here's a simplified strategy that, provided you've a minimum comfort level with SSH and CLI, will get your files moved securely and quickly:

  1. Generate a key-pair on the destination server using the command ssh-keygen. When prompted, specify location /app/.ssh/id_rsa
  2. Update file permissions for the private key chmod 400 /app/.ssh/id_rsa
  3. Get the contents of the public key to and add it to the source server
  4. Navigate to wp-content on the destination server cd ~/www/wp-content
  5. Run rsync. Replace {port}, {username} and {host} with your source server's connection details, and /path/to/wp-content/ with the path from your server's root to your WP installation's wp-content directory. Be sure to include the trailing slash.
    rsync -avz --include 'plugins' --include 'themes' --include 'uploads' --include 'languages' -e 'ssh -p {port} -i /app/.ssh/id_rsa' {username}@{host}:/path/to/wp-content/ /app/www/wp-content/
  6. Remove keys from the destination server rm /app/.ssh/{id_rsa,id_rsa.pub}

The database.sql export file can be moved in a similar fashion.

Tips on making rsync faster (note: arcfour is old and you should try the chacha20-poly1305 cipher instead in the ssh -c option)

danger

Remember: don't ever move your personal private keys around or share them. The keys generated during this process should be created and removed as described.

Migrating your files and database the easy way

Run a tool like WP Migrate DB Pro or All-in-One WP Migration

Updating your DNS

Create a CNAME from your domain to lb.tangiblexp.com
Go into the txp dashboard at app.tangiblexp.com
Click on the application you want to modify and select "Domains"
Click on "Add Domain" and add the domain you wish to use.
Click on "Change Primary" and select the domain you just created.