How risky to rei-stall my Wordpress software?
December 13, 2010 8:30 AM
How risky is to use the "re-install Wordpress automatically" function? I have an establish blog with a lot of visitors. My host (Dreamhost) notified me a few days ago that it was being used for denial-of-service attacks and they deleted the offending files. I've examined all my files and changed all my passwords since then to prevent any more problems. Everything seems OK now but even so I'd like to re-install Wordpress if I can do so without risk. I have recent backups but I don't have the time to rebuild the site right now if it gets screwed up.
I use Dreamhost - do not allow them to reinstall before you back up your database. If you allow them to reinstall you probably will lose all your posts/data. If you are unfamiliar with phpMyAdmin, avail yourself of one of the many WordPress plugins for backing up your database.
posted by brownrd at 9:25 AM on December 13, 2010
posted by brownrd at 9:25 AM on December 13, 2010
All the data from your posts, comments, etc are stored in a mySQL database. If you reinstall Wordpress, being careful to not overwrite your config file or your themes directory, everything should be fine. When you do a manual upgrade of Wordpress you essentially are doing the above, so follow the upgrade directions from Wordpress.org.
But make sure you back up the dB first, just in case. I'd also do a full export, as a double just in case.
BTW, I've stuff go horribly wrong when trying to maintain Wordpress through CPanel. If you are doing it that way, stop. Do a clean manual upgrade, then maintain through Wordpress itself.
posted by COD at 9:45 AM on December 13, 2010
But make sure you back up the dB first, just in case. I'd also do a full export, as a double just in case.
BTW, I've stuff go horribly wrong when trying to maintain Wordpress through CPanel. If you are doing it that way, stop. Do a clean manual upgrade, then maintain through Wordpress itself.
posted by COD at 9:45 AM on December 13, 2010
Did you do the one-click easy install or the custom install? The easy install might be more dangerous if they re-create the database and such for you. The last custom install I did was drupal and they basically just did the fetch-untar into your domain directory. And are you talking about some Dreamhost provided re-install or a wordpress provided re-install like the auto-upgrade?
Much easier to do the backup online from your shell account either way. If your domain is simple and just hosting a blog, or you have a blog under a sub-domain, either is just a directory in your home directory.
You might have to backup more than one database depending on how Wordpress does things.
posted by zengargoyle at 10:12 AM on December 13, 2010
Much easier to do the backup online from your shell account either way. If your domain is simple and just hosting a blog, or you have a blog under a sub-domain, either is just a directory in your home directory.
# login
$ ssh zg@jklmnop.net
# list of domains
zg@jklmnop:~$ ls -d *jklmnop.net
jklmnop.net mu.jklmnop.net svn.jklmnop.net zg.jklmnop.net
# list of databases
zg@jklmnop:~$ mysql -h mysql.jklmnop.net -u zen_jkst -p -e 'show databases'
Enter password:
+--------------------+
| Database |
+--------------------+
| information_schema |
| zen_jkst |
+--------------------+
# backup the 'zen_jkst' database (yes my db username is same as database name)
zg@jklmnop:~$ mysqldump --add-drop-database --add-drop-table -h mysql.jklmnop.net -u zen_jkst -p zen_jkst > dump.sql
Enter password:
# look at dump for some sanity
zg@jklmnop:~$ less dump.sql
# backup the domain files, the trailing '/' is important.
zg@jklmnop:~$ rsync -av zg.jklmnop.net/ my-backup
# ... a bunch of stuff flows by
# compare the two directories for some sanity :)
zg@jklmnop:~$ diff -r zg.jklmnop.net my-backup
# do your re-install here, if it blows things up then restore.
# reload database from the dump
zg@jklmnop:~$ mysql -h mysql.jklmnop.net -u zen_jkst -p zen_jkst < dump.sql
Enter password:
# replace the mucked up directory with the copy
rm -rf zg.jklmnop.net
mv my-backup zg.jklmnop.net
# get rid of backups if you don't need them anymore
rm -rf dump.sql my-backup
You might have to backup more than one database depending on how Wordpress does things.
posted by zengargoyle at 10:12 AM on December 13, 2010
As I remember, WP only uses one database per blog (usually wp_whatever). So you can dump and restore the DB using zengargoyle's method, and just make a backup copy of the wordpress directory, which reduces the risk of accidentally deleting your database password or customized themes.
posted by pwnguin at 10:21 AM on December 13, 2010
posted by pwnguin at 10:21 AM on December 13, 2010
This thread is closed to new comments.
posted by theichibun at 9:15 AM on December 13, 2010