Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Documentation: Moving a Standalone WordPress Site to a MultiSite Sub-Site
- This guide outlines the steps to migrate a standalone WordPress site to a sub-site within a WordPress MultiSite installation. It assumes you already have the sub-site set up on the MultiSite instance.
- ### Prerequisites:
- - Existing WordPress MultiSite network.
- - A standalone WordPress site that you want to migrate.
- - Access to both the phpMyAdmin of the standalone site and the MultiSite installation.
- - Access to both the file systems of the standalone site and the MultiSite installation.
- ### Steps:
- ---
- ### **Step 1: Export the Standalone Site Database**
- 1. **Access phpMyAdmin**:
- Go to the hosting server where the standalone WordPress site is hosted. Log in to phpMyAdmin.
- 2. **Export the Database**:
- Select the database associated with the standalone WordPress site and export it in SQL format.
- - Choose "Quick Export" for simplicity, or "Custom Export" if you need specific configurations (recommended: ensure "Add DROP TABLE" option is selected).
- ---
- ### **Step 2: Import Database into the MultiSite Instance**
- 1. **Access phpMyAdmin on the MultiSite Server**:
- Log in to phpMyAdmin on the MultiSite server.
- 2. **Import the Database**:
- Go to the correct database for your MultiSite setup. Select "Import" and upload the SQL file you exported from the standalone site.
- 3. **Change Table Prefixes**:
- After importing, you'll need to update the table prefixes to match the sub-site you are migrating into. For example, if your sub-site's ID is `2`, you'll need to rename all the tables with a prefix like `wp_2_`.
- To do this:
- - Rename the tables in phpMyAdmin to match the format `wp_2_` instead of the original `wp_`.
- - Update the table names for:
- - wp_posts → wp_2_posts
- - wp_postmeta → wp_2_postmeta
- - wp_options → wp_2_options
- - wp_users → (No change, as this table is shared across the network).
- - wp_usermeta → (No change).
- ---
- ### **Step 3: Copy the Uploads Folder**
- 1. **Locate the Uploads Folder**:
- On the standalone site’s server, navigate to the `wp-content/uploads` directory.
- 2. **Copy Files to MultiSite Server**:
- On the MultiSite server, find the correct directory for the sub-site, which would be located at `/wp-content/uploads/sites/2/` (replace `2` with the correct site ID).
- - Copy all the files from the old site's `/uploads` directory to this new path.
- ---
- ### **Step 4: Migrate Plugins and Themes**
- 1. **Migrate Plugins**:
- If your standalone site uses any plugins that are not present on the MultiSite instance, copy those plugins from the standalone site’s `/wp-content/plugins/` folder to the same folder on the MultiSite server.
- 2. **Migrate the Theme**:
- If the standalone site uses a custom or non-default theme, copy the theme folder from the standalone site’s `/wp-content/themes/` directory to the MultiSite server’s `/wp-content/themes/` folder.
- ---
- ### **Step 5: Verify Site Functionality**
- 1. **Check Site URL**:
- Go to the URL of the newly migrated sub-site. For example, if the sub-site’s domain is `https://example.com/subsite`, you should now see the migrated site content.
- 2. **Test Functionality**:
- Verify that:
- - Posts and pages are displaying correctly.
- - Media files load without issues.
- - Plugins and themes are functioning as expected.
- 3. **Update Permalinks**:
- Log into the admin dashboard of the sub-site and navigate to **Settings** > **Permalinks**. Click “Save Changes” to regenerate the permalink structure.
- ---
- ### **Troubleshooting Tips**:
- - **Missing Media Files**:
- If images or media aren’t displaying, double-check that all files from the `uploads` folder have been copied to the correct sub-site directory (i.e., `/wp-content/uploads/sites/2`).
- - **Database Connection Errors**:
- Ensure that the database table prefixes are correctly updated to match the MultiSite’s sub-site. For instance, for sub-site `2`, all WordPress tables should start with `wp_2_`.
- - **Login Issues**:
- If you cannot log into the sub-site after migration, check the `wp_2_options` table for the correct `siteurl` and `home` values, as well as potential user account conflicts.
- ---
- ### Conclusion:
- By following these steps, you will successfully migrate a standalone WordPress site into a sub-site on your WordPress MultiSite network. If any issues arise during the migration process, review each step carefully, especially the database prefix changes and file locations.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement