I have large DB of blog post I already export it by year and wanted to make archive by year doing it on subdomain, like 2012.mysite.com
I stack looking for solution on internet, I wondering if their are someone done this before? and can advise me a good solution, all I wanted is to separate to another db by year for archiving.
I have a knowledge in PHP and MYSQL.
I needed this for a client recently (he wanted to do the same but be able to create a archive by himself in the wordpress backend) and couldn’t find a good plugin for it. It’s pretty easy to custom code this actually. You just need to make your install a network install and then place a custom
install.php
in yourwp-content
folder to overrite the wp_install_defaults() function. In this function you just have to write a few SQL statements that move over the content from one site to the other.In the end the only thing I needed to do was to create this custom
install.php
(you may need to modify this to suit your needs, but I guess it’s a good starting point):If you have a lot of plugins installed you also need to care about the custom tables individually. I only had one plugin installed (needed to modify
avhec_term_order
) only.Basically what will happen if you create a new site in the network administration then, is it will move all the posts from your main blog into your archive blog.
Performance wise MySQL just doesn’t handle large tables well, there is no performance benefit in using a total seperate database. It’s enough to use seperate tables in my experience. But if you for some reason really want to have seperate database (the above solution is only based on tables as this is how WPMU works) you can have a look at HyperDB.