Migrating the blog server
Taking advantage of the blog is having technical difficulties, I decided to change it from server and update the broken version of WordPress.
The details for the update of WordPress may vary from version to version and can be found on- site .
I could use the options to import / export of WordPress itself, but one of the problems with the old provider, was that I was not able to access the administrative area of the blog. Without even making a single upload of anything I could no longer log into the blog and the response I got was the provider:
"... Contact the developers of the WordPress ..."
I then decided to contact a competitor and migrate to the nail ...
The Amortization prior I used were quite simple, and are as follows:
Hiring the new provider
I did some Internet searches, consulted friends, and at the end was just filling out a form, number of credit card and wait for the confirmation of payment.
Backup
While I waited for confirmation of the new provider, I was backing up the blog. As I had too much "junk" installed, I decided to just back up the database with the posts, and use a quite clean version of WordPress.
To back up the MySQL I used one of its command-line tools mysqldump. One of the coolest features (in my opinion) mysql and its tools, is the ability to use them remotely. This has saved my skin a few times in times of SysAdmin.
The command was simple:
=my.old.mysqlserver user @ host: ~ $ mysqldump - host = my.old.mysqlserver - User = myuser - password mybkp.sql - Databases myblogdatabase> mybkp.sql
= My.old.mysqlserver-host: Connect to the host where is my MySQL database
-User = myuser: Use this server for connection.
-Password: Ask a password prompt. If I wanted to enter the password directly, could have done-password = mypass.
Myblogdatabase-databases: Make a dump of all the database tables 'myblogdatabase', used by my blog.
> Mybkp.sql: Redirect the output to a file.
Mysqldump generates all the SQL needed to recreate the database in the same state it was.
Restoring data
At the beginning of the dump file is the reference to the old database. If the new database has a different name you must edit the dump file. This can be done with the command sed:
s /` olddatabase `/` newdatabase `/ mybkp.sql > mynewbkp.sql user @ host: ~ $ sed s / olddatabase `` / `` newdatabase / mybkp.sql> mynewbkp.sql
The restoration is very simple, using the mysql prompt:
=my.new.mysqlserver --user =myuser --password user @ host: ~ $ mysql - host = my.new.mysqlserver - user = myuser - password mysql> use newdatabase; mysql>. mynewbkp.sql
This logamos, we enter the new base, still empty, and do a full dump file with SQL statements to recreate the tables and the data from the old into the new.
Upgrading WordPress
WordPress Update follows the basic steps of installation : download, unpack, move the content to the desired location and edit the file wp-config.php.
Finally, with the browser, execute the file
http://my.blog.root.path/bla/bla/bla/wp-admin/upgrade.php
And voila! You will receive a random password for the admin user, just login.
Setting up WordPress
When the provider provides the service, it usually provides two ways for you to access the site's features. One is the standard way to use your domain as address, since the other provides the same capability as a strange url. Today I found out why: while the DNS provider was appointed to the former, I accessed the url in strange new provider without interfering with (mal) functioning of the old site.
After WordPro installed, any attempt to access the content, redirected to the old blog. Then I remembered that there are two options for configuring the url in the blog. Was enough to know where it was in the database. Following the logic of table names, arrived at the table wp_options.
Using the GUI tool MySQL Query Browser, change the fields 'option_value' that correspond to the fields 'option_name' option 'siteurl' and 'home' to that url strange, and I started using and enjoying it during the migration, while installing plugins and themes . After all is done, I changed the DNS and finally restored the original values in the options. This command line would look like this:
; mysql> select * from wp_options limit 1; +-----------+---------+-------------+------------- ------------+----------+ blog_id | option_name | option_value | autoload | | Option_id | blog_id | option_name | option_value | autoload | +-----------+---------+-------------+------------- ------------+----------+ | 0 | siteurl | http: // mydomain.com / etc | yes | | 1 | 0 | siteurl | http:// mydomain.com / etc | yes | +-----------+---------+-------------+------------- ------------+----------+ ( 0.00 sec ) 1 row in set (0.00 sec) ; mysql> select * from wp_options where option_value = 'http://mydomain.com/etc'; +-----------+---------+-------------+------------- ------------+----------+ blog_id | option_name | option_value | autoload | | Option_id | blog_id | option_name | option_value | autoload | +-----------+---------+-------------+------------- ------------+----------+ | 0 | siteurl | http: // mydomain.com / etc | yes | | 1 | 0 | siteurl | http:// mydomain.com / etc | yes | | 0 | home | http: // mydomain.com / etc | yes | | 40 | 0 | home | http:// mydomain.com / etc | yes | +-----------+---------+-------------+------------- ------------+----------+ ( 0.00 sec ) 2 rows in set (0.00 sec) option_value = 'http://url.estranha.com/etc' mysql> update wp_options September option_value = 'http://url.estranha.com/etc' where option_value = 'http://mydomain.com/etc'; 0.02 sec ) Query OK, 2 rows affected (0.02 sec) Warnings: 0 Rows matched: 2 Changed: 2 Warnings: 0 mysql>
The SQL command was the first to know which fields of the table, the second to check which options have the same url and the third, finally updating. After that, the blog is already pointing to the correct work address, and the return can be made through the site normally.
Conclusion
Migrate a blog on the nail is not the best option, since you risk losing all data. I just got this close, because I know a little of the functioning of WordPress and the tools around. Still, I had my moments of suspense. Despite keeping up a home separate from the posts, I could not save your comments and options in general. In some ways it was good for me to get smart and go doing my weekly backups of the site.

