Please use internal. However, we will show you how to perform a word press backup using wp-cli. First, verify that wp-cli can detect WordPress sites. Execute the following command: WP core installed. If you receive any type of error message, make sure WordPress is running and in the correct WordPress directory in the console. After the setup is complete, you can start the backup as easily as you enter the following: Export WP DB this command must generate a database backup. If it runs correctly, it must receive a success message. If all goes well, you can ignore the file. But if something goes wrong, it can be very useful. How to import the database by entering the appropriate command will be described later. The
Step 2: before continuing to find and replace the old domain name, especially if you followed one of the previous wp-cli guidelines, make sure that search replace is enabled on the server. WP cli checks whether search replace is not under the disabled command list. The YML file must be checked. If yes, simply delete and save the settings file. It is time to search and replace all previous instances in the domain. The search replace command follows the formula of WP search replace \
WP search replace http:\/\/olddomain.com ” http:\/\/newdomain.com \
Step 3: test whether everything works. This process is very simple, but if you change the domain name, the site with the wrong configuration may have strange problems. At this point, ensure that the browser can continue to access the web site and other pages, and ensure that all references to the previous domain have been correctly updated. One advantage of wp-cli is that even if the site goes down in the browser due to PHP related or redirection conflicts, it can always be accessed from the command line. This allows you to make the necessary adjustments to regain normal access. The
If in the worst case there is a problem that cannot be modified, you can reset the site to the backup you originally created by entering the following: Import WP DB this command completely ignores changes made after exporting the database. Of course, if you are satisfied with the adjustment, it is best to avoid it. As you can see, wp-cli makes domain name change an incredibly simple process. Once configured on the server, you can use several selection commands to handle many previously complex tasks. Abandoning the graphical user interface may require some adjustments, but the power benefits available will be balanced. The
This post shows how to change the domain name within the site content in a few minutes. The export, search replace, and import commands can fully manage the switch in seconds without the need for external front-end plug-ins. Is there a question asking how to use the WP cli search replace command to change the domain? Below
Please tell me in the dog section! Image credit: ericbailey