Friday, December 24, 2004

Mirroring Launchpad Zero At Home

— Matt Harris @ 5:59 pm

I do all of the development work on this site at my home computer. The home system is where I test whether posts will look right, etc. When it is sufficiently formatted to my liking, I’ll copy the post to my production website (this one). Occasionally, though, I will post from work or elsewhere to the production site, causing my home database to be out of sync with the production one. It can be a pain to have to cut and paste each post into the local version whenever I got home.

Fortunately the One-Click Backup plugin creates an easily downloadable SQL file that I can run on my home machine and update my local database. It does have a downside, though – it causes the Siteurl for the local database to point to the production website, and all of the WordPress scripts reroute everything there. This makes it impossible for me to edit or post to the local version of my site.

I did some snooping around in the WordPress tables today and found where the site URL is stored. It is stored in a table called “lz_options” (“wp_options” for default installations) as the option “siteurl”. This option is conveniently located as the first entry in the table. The following SQL updates it so that the local version of WordPress admin scripts point to my local version of the website:

UPDATE `lz_options`
SET `option_value`='http://lz/Weblog'
WHERE `option_id`=1 AND `blog_id`=0 AND `option_name`='siteurl'

If I just run the above SQL each time after restoring from the production site, everything works wonderfully.

Comments Off on Mirroring Launchpad Zero At Home

Comments are closed.

Archives

  • 1530s Europe Campaign (15)
  • Books (7)
  • BTVS & Angel (24)
  • Cormaria (22)
  • Doctor Who (1)
  • Fanfiction Recs (19)
  • General (36)
  • Harry Potter (19)
  • Humor (16)
  • Java (1)
  • Microsoft Office (2)
  • Northridge Pathfinder (24)
  • OpenOffice.org (1)
  • Pathfinder (30)
  • Politics (4)
  • Programming (6)
  • Programs (5)
  • Reviews (2)
  • Role-Playing Games (D&D et. al.) (85)
  • Science (1)
  • Site News (120)
  • Smallville (2)
  • Stargate (2)
  • Tips (4)




  • Powered by Wordpress