Βοήθεια

WordPress με διαχείριση Βοήθεια

Make final edits to my WordPress site files

Note: This is the sixth and final step in manually migrating a WordPress site to your Pro Managed WordPress account. If you don't have a Pro Managed WordPress account, you can learn more about them here.

Part 1: Copy the wp-content folder Part 2: Make an SQL dump file
Part 3: Upload the site content Part 4: Update the site database
Part 5: Change the table prefixes Part 6: Make final edits
Required: You need to use an FTP application (we'll use FileZilla here) to update one more file, and an SSH application (for Windows: PuTTy, for Mac: Terminal) to search-and-replace the site URLs.

This is the final step to manually migrate a WordPress site to a Pro Managed WordPress account. Give yourself five to ten minutes to complete this step.

Note: If you did not have to change the table prefixes as described in Part 5, start with Step 7 in this article. Otherwise, start with Step 1.

  1. Open FileZilla and connect to the site using your sFTP credentials (remember, you got these back in this step.
  2. In the Remote site field, type /var/www/wp-content and press Enter.
  3. In the list of files, right-click wp-config.php and select View/Edit. The .php file opens in your default editor; if you need to select the application used to edit this file, select a text editor.
    edit wp-config.php file
  4. Look for the line '$table_prefix = 'wp_';.
    find table prefix line
  5. Replace wp with the table prefix you copied in Part 5. In this example, the table prefix is abc123.
    edit table prefix

    Note: Be careful not to delete the underscore character that follows the table prefix.

  6. Save the file. If you're asked to overwrite the file, agree.
  7. Open an SSH application and connect to the site. You'll need your Host, Username, and Password credentials again.

    [On Mac, use Terminal: ssh username@hostname, and then enter your password when prompted.]

  8. After you sign in and establish the SSH connection, enter: wp search-replace 'oldurl' 'newurl' --dry-run, where:
    • oldurl is the complete URL (including "http://" or "https://") for the original site you are migrating into the Pro Managed WordPress account.
    • newurl is the complete URL (including "http://" or "https://") for the Pro Managed WordPress site you created for the migration, even if it's a temporary URL.
    • --dry-run tells WordPress to run the command and report the results - but doesn't actually change anything in the database. This way we can check to make sure you've gotten the URLs right, and if there's an error you won't break anything.
  9. Note: Make sure the URLs you use in this command exactly match the URLs for the migrated site and the new site.

  10. Press Enter to run the command. It'll take a few seconds for WordPress to finish the work. On success, you'll see how many changes are going to be made to the database tables.
    dry run success

    Note: If you get a success message, but it says 0 replacements will be made, check both of the URLs again, and then repeat the previous step. The URLs must be completely accurate or this command will not work.

  11. If you got the success message and it noted that more than 0 replacements will be made, enter: wp search-replace 'oldurl' 'newurl', where oldurl and newurl are the complete URLs for the old and new sites as described earlier.
  12. Press Enter. WordPress completes the search-and-replace, and revises the database. On success you'll see the number of changes that were made.
  13. Log in to the WordPress site and verify that everything looks as expected.
  14. Note: There may be layout changes you need to revise in the WordPress editor.

Next step


Ήταν χρήσιμο αυτό το άρθρο;
Σας ευχαριστούμε για τα σχόλια. Για να μιλήσετε με έναν εκπρόσωπο της εξυπηρέτησης πελατών, χρησιμοποιήστε τον αριθμό τηλεφώνου υποστήριξης ή την παραπάνω επιλογή συνομιλίας.
Χαιρόμαστε που βοηθήσαμε! Υπάρχει κάτι άλλο που μπορούμε να κάνουμε για εσάς;
Λυπούμαστε. Πείτε μας τι σας μπέρδεψε ή γιατί η λύση δεν ήταν αποτελεσματική για το πρόβλημά σας.