Documenting a WordPress Migration

语速

Previously, WordPress was running on CentOS 7; the performance of this machine was often underutilized, so some migration was needed to improve performance. To avoid losing relevant data, the WordPress migration work was carried out. This article documents the WordPress migration process.

To minimize the time spent on backups, I first used the WordPress plugin, All-in-one WP migration. This plugin can back up plugins, articles, themes, and other plugins.

When backing up the old website, I downloaded the generated backup file.

When creating the new website (via Coolify), the file upload kept failing. I wasn’t sure what was happening.

Subsequently, I modified several upload restrictions.

One of them was .htaccess.

1
2
3
4
5
  php_value upload_max_filesize 200M
  php_value post_max_size 200M
  php_value memory_limit 256M
  php_value max_execution_time 300
  php_value max_input_time 300

Another one is wp-config.php

1
2
3
4
5
  @ini_set( 'upload_max_filesize' , '200M' );
  @ini_set( 'post_max_size', '200M');
  @ini_set( 'memory_limit', '256M' );
  @ini_set( 'max_execution_time', '300' );
  @ini_set( 'max_input_time', '300' );

My backup file is 199MB in size. However, despite adjusting the two files mentioned above, I found that I still couldn’t restore the backup. This left me puzzled. Through console debugging, I discovered that after the upload was completed, the server would return an HTTP 413 error. Later, I found this article and identified the issue.

After troubleshooting, I realized that the problem was actually caused by Cloudflare. The free Cloudflare plan does not support file uploads larger than 100MB, resulting in an HTTP 413 error.

Subsequently, I configured my local hosts file to allow the domain to directly connect to the server’s real IP address.

Finally, it succeeded.