Massive Wordpress database migration - mysql

This is a doozy of a question...
I am developing a new wordpress website to replace my client's massively sized blog (tens of thousands of pages). Their existing blog is built on a custom PERL blogging platform from 1992...so as you can imagine, it needs updating.
My job is to find the BEST possible way to migrate all of their existing data into a format that wordpress can understand.
The new theme is very advanced, and this job is very advanced as well. After searching for specialists, I can't seem to find anyone who specialized in this field. What would you do in this situation? Thanks!

I've done this before, it's not that hard. I approached it as a wordpress plugin. First get the plugin to connect to the old database and get it to pull the information you need. Then you can use native wordpress function to insert new users, posts, comments, etc.
I did it line by line, which isn't the most efficient approach, but it is the easiest. I used an AJAX front-end to display the conversion status and repeatedly call the converter back-end, as the actual migration took up to several hours.
If the site can't be shut down for that long while you migrate the database, you could either look at doing a proper bulk export/import, or lock old topics and migrate those over first.
My converter was for an old PHP nuke site, and due to the fact that we were using WP-United, I didn't have to worry too much about user credentials and comments. However, the code might help you get started: http://www.wp-united.com/releases/php-nuke-converter

I have done a couple of these Wordpress migrations. The theme you're using in Wordpress is really not that big a deal, most likely. Themes in Wordpress don't ordinarily impact the database structure.
The Wordpress side is easy, it's in MySQL in most cases. The place to start for you would be to determine how the data in the PERL blog is stored. If it's a custom blog solution, there probably isn't a script you can find to do the migration. Hopefully, it's in a data form that will allow you to do a data dump in a format MySQL will allow you to import using something like phpMyAdmin (a popular GUI for MySQL). At that point, you can create a MySQL statement to match up the relevant fields in your old data with those in MySQL. If you're not comfortable doing it and want an expert, the thing to do is find out how the PERL blog stores it's data and find someone who is familiar with both that format and MySQL.

Related

Using PYQT with wordpress

I hope this is not an obvious question. However, I cant find any resources online, since everytime i google wordpress with pyqt, i get websites made with wordpress talking about pyqt.
Are there are resources or tutorials on integrating pyqt with wordpress. Or is this too vague, and it should be pyqt with mysql? Or is this just a bad way to write a program in python that gets data from a mysql database?
My understanding what you're looking for here is not to integrate PyQt with WordPress, but rather Python itself. PyQt it simply a toolkit that offers the GUI (and many more) module that you're likely using, but Python is still the "backbone" of your application.
In order to manipulate the database that WordPress uses, you'd have to manipulate that very database. For that, I recommend MySQLdb Python module. Alternatively, you could use the QtSql that PyQt comes with, but I honestly don't see the need for that.
However, I have to advise you that altering the database directly could have unwanted consequences and it could potentially break your WordPress installation - so make sure to backup the database often. Also, this poses a certain security risk. If I were you, I'd create a WordPress API (there may already be one, I'm not that familiar with WordPress) that will take HTTP requests and send responses as well, which your Python program would then use.

Add joint primary key to wordpress posts table

I am working out how to synchronize wordpress installations where both can be updated simultaneously, and both can work offline, then come online to sync.
I think the easiest way to sync posts between sites, is to include the site id in the primary key of the posts. Therefore, any post is identified by an incremental id and the id of the server location it was created from.
Is this possible to achieve with a plugin?
What dangers lie ahead if I pursue this path?
Is there a better, alternative way to achieve what I am trying to achieve?
It is possible in several ways:
- Write a stored procedure inside the first Wordpress installation's php files, that inserts the content into the other database when something is written to it. This one probably won't work offline.
- Write a function that compares the two databases at a schedule time using a simple sql query and creates a diff log. Then copies over the difference to the other database.
It depends why you need to do this, but if this works, I would recommend this solution:
- Keep one wordpress installation. Maintain one database, and connect to it from the other website to load the content. You can create your own SQL connection to it and load whatever content you need.
- Keep one wordpress installation, and use it's RSS feed to read the content and display it in whichever second website you need to do it in.
I can't imagine how a plugin would be of much help, especially keeping the databases in sync offline too. In my experience, its usually better to write your custom php scripts, rather than use a plugin so you can have a more direct control over the functionality.
Hope this helps.

I have a website with CMS. Can I use Drupal to build a secondary CMS without changing the primary one?

I like taxonomies in Drupal and thinking about building a CMS on it for a website that has been online for years. I'd like to leave the database AS IS (it's mySQL) to make sure the old CMS works as well - some people who use it aren't willing to learn new stuff. The website in question is a products catalog and I'd like to extend it to also manage orders, inventory, samples and QA documentation.
It seems that using two databases - one for drupal itself and the other for data - has other pros as well. It's like separating model from view.
I'm not a frameworks kind of guy - I rather like to do things from scratch employing only minimal number of dependencies and intermediary layers. I like the Drupal's approach and appearances though.
Is Drupal the right tool for the job? How easy is it to use it with existing database without importing all the data into drupal's db? Am I going right direction? Thanks a lot!
I think it is nearly impossible to reuse the existing database as is with Drupal.
If you still want to use Drupal, there is a rather sophisticated module to help moving the data to a database Drupal will like: http://drupal.org/project/migrate

Migrating subsets of production data back to dev

In our rails app we sometimes have db entries created by users that we'd like to make part of our dev environment, without exporting the whole table. So, we'd like to be able to have a special 'dev and testing' dump.
Any recommended best practices? mysqldump seems pretty cumbersome, and we'd like to pull in rails associations as well, so maybe a rake task would make more sense.
Ideas?
You could use an ETL tool like Pentaho Kettle. Once you have initial transformation setup that you want you could easily run it with different parameters in the future. This way you could also keep all your associations. I wrote a little blurb about Pentaho for another question here.
If you provide a rough schema I could probably help you get started on what your transformation would look like.
I had a similar need and I ended up creating a plugin for that. It was developed for Rails 2.x and worked fine for me, but I didn't have much use for it lately.
The documentation is lacking, but it's pretty simple. You basically install the plugin and then have a method to_sql available on all your models. Options are explained in README.
You can try it out and let me know if you have any issues, I'll try to help.
I'd go after it using a Rails runner script. That will allow your code to access the same things your Rails app would, including the database initializations. ActiveRecord will be able to take advantage of the model relationships you've defined.
Create some "transfer" tables in your production database and copy the desired data into those using the "runner" script. From there you could serialize the data, or use a dump tool, since you'll be dealing with a reduced amount of records. Reverse the process in the development environment to move the data into the database.
I had a need to populate the database in one of my apps from remote web logs and wrote a runner script that fired off periodically via cron, ftps the data from my site and inserts the data.

How can I get my content from a Joomla blog into Blogger or Wordpress?

I have an old joomla site (v 1.0.11) that I would really like to move over to Blogger or Wordpress. The commenting on the site uses AkoComment which was an add on module. Basically, I want to transfer:
posts
comments
users
css
I haven't found a good tool out there to do this. What tools would be best to begin to work with this data? The joomla database is MySql. I would prefer to use blogger as you don't have to pay to host sites on it. That means though that I don't have direct access to the database. Blogger takes Atom feeds as import. The default Atom feed on Joomla will only list the last five posts though, not all, and won't include comments.
Any help here would be appreciated!
There's no easy way. All your user data in particular will be impossible to migrate due to the completely different ways the two systems would handle passwords and so on.
For the posts though, you probably can migrate them. You'll have to study the format of each platform's database tables and create a query or two to migrate data. For example, something like the below would work. Most of the variables listed here are not the actual ones, you'll need to replace them with whatever's appropriate. The 1 is whatever your ID is in the new system.
INSERT INTO wordpress_db.wp_posts ( `wp_author`, `wp_post`, `wp_date` )
SELECT 1, `content`, `posted` FROM joomla_db.jos_content
Write an HTTP bot to submit the data from your database or build a megafeed with all your Joombla blog entries. I personally enjoy coding this kind of scripts.