09.28
Getting multiple wordpress blogs into one place.
1. Change the upload location to a folder in the main directory of the sub-domain. The example here is kitsquilts.norova.com
I made a directory at kitsquilts.norova.com/wp-uploads
In the Settings >> miscellaneous section, I changed:
Store uploads in this folder to: /home/norova2/public_html/kitsquilts/wp-uploads
And the (says it’s optional, but necessary) full html path to: http://kitsquilts.norova.com/wp-uploads
Now all future uploads should be directed to this folder. All old uploads are still pointed to the old upload folder, so I need to actually edit the MySql table itself to clear up the inconsistency.
Then in the MySqlPHP menu, I performed the following two queries:
UPDATE wp_posts SET guid = replace(guid, ‘wp-content/uploads’,'wp-uploads’);
UPDATE wp_posts SET post_content = replace(post_content, ‘wp-content/uploads’,'wp-uploads’);
…as per the instructions of this guy.
Then it turned out, there were some leftover inconsistencies from when I had moved mom’s site from a sub-dir (wp_kitsquilts/) to the main site (/). Basically “wp_kitsquilts” appeared in many MySql tables. So I used the following commands, in this order to clean them up:
UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘/wp_kitsquilts/wp-content/uploads/’,'/wp-uploads/’);
UPDATE slimstat SET resource = replace(resource, ‘/wp_kitsquilts/wp-content/uploads/’,'/wp-uploads/’);
UPDATE slimstat SET resource = replace(resource, ‘/wp_kitsquilts/’,'/’);
UPDATE wp_posts SET guid = replace(guid, ‘/wp_kitsquilts/’,'/’);
I figured out which tables to edit by using the phpmyadmin search commands to search for the strings “/wp_kitsquilts/wp-content/uploads/” and “/wp_kitsquilts/”, so that I could then replace them in the tables with the appropriate values. Now all of mom’s old uploaded pics show up just fine, and appear in the gallery the way they should – finally!
2. Get all of the wordpress files back into their own handy directory.
I went to the main directory of kitsquilts.norova.com and collected all files and folders that pertained to wordpress, except for index.php. Then I moved them to a subfolder called “wordpress0/”. I updated the “home” and “site_url” fields in the MySql table to reflect the new locations. I also edited the line in index.php which loads the wp-header.php file, making sure it pointed inside the directory “wordpress0/”.
So far, the uploads for mom’s site will be in an independent directory outside of any wordpress heirarchy, and all of the wordpress heirarchy is contained in its own folder “wordpress0″.
3. Set up multiblog config files for calling up mom’s site. Basically just make a VUSER as per the multiblog instructions. Then make a mb-config-kitsquilts.php config file with mom’s database and login info.
4. Create a symlink to www.norova.com/wordpress/ on mom’s subdomain using add_symlink.php:
<?php
symlink( ‘/home/norova2/public_html/wordpress/’, ‘kitsquilts/wordpress’ );
?>
No Comment.
Add Your Comment