How do I install my wordpress blog locally?

I have wordpress 2.3 online, and just installed 2.5 locally on my computer- how do transfer all of my articles and such to work locally so i can run tests on my blog offline so i can save bandwidth and visitor's headaches?

Public Comments

  1. Go to control panel of your hosting where your real blog in to database section. Export database. And import this in to database localy. After that install ( on option upgrade ) new wordpress localy. have fun :)
  2. To begin with, you really have to be using the same Wordpress version on both ends, because the database structure may change between releases; and although there are "upgrade" tools to convert a database created by an old Wordpress release to work with a newer Wordpress release, there are no "downgrade" tools to convert a modern database to work with an older Wordpress release. So first, either install 2.5 on your web host, or install 2.3 locally. It shouldn't matter which versions of Apache, PHP and MySQL you are running on your end, as long as they are reasonably up-to-date; so either go with your distro's packages, or download and compile the latest Source Code from the various projects' own home pages. The next bit depends on how your ISP's database server is set up; I'm going to assume the server is "mysql.myisp.co.uk", your database is called "fredwp", your MySQL username is "fred" and your MySQL password is "b00bies". Make appropriate substitutions. Once you have done this, then dump the database on the server which is storing your Wordpress stuff. You should be able to do this from an XTerm on your end: $ mysqldump -h mysql.myisp.co.uk -u fred -p fredwp > databasedump This will ask you for a password, then create a file called "databasedump" with a bunch of MySQL statements to recreate the database. Now you need to set up a database and a user your end, exactly matching your ISP's server. So $ mysql -u root mysql> CREATE DATABASE fredwp ; mysql> GRANT ALL ON fredwp.* TO fred@"%" IDENTIFIED BY "b00bies" ; Press ctrl+D to get out of MySQL. Finally, you need to recreate the database. This time, you want to connect to MySQL as your own database user. $ mysql -u fred -p fredwp (you will be asked for your password) mysql> SOURCE databasedump; This will read in the file "databasedump" you created earlier and process the commands, which rebuilds a copy of your database. Press ctrl+D again to get out of MySQL. You should now be able to go through the Wordpress setup on your local machine. To restart from scratch with a clean copy of the database, you can do: $ mysql -u root mysql> DROP DATABASE fredwp ; and then repeat everything from CREATE DATABASE fredwp ; onwards. To transfer your database to the remote server, first take a dump of each copy: $ mysqldump -h mysql.myisp.co.uk -u fred -p fredwp > old_remote $ mysqldump -u fred -p fredwp > current_local Connect to the remote server: $ mysql-h mysql.myisp.co.uk -u fred -p fredwp mysql> SHOW TABLES; This will give you a list of tables making up your database. For each one, type mysql> DROP TABLE tablename ; to delete the existing tables. Then mysql> SOURCE current_local ; to import the most recent dump of your local copy of the database. Lastly, log into Wordpress on your ISP's server, and you should find it is all the same as your local one was.
Powered by Yahoo! Answers