Jump to content

Wordpress Offline and importing an online database backup


Stevie

Recommended Posts

If that makes sense? I've been looking for guides but can only find old ones that don't explain what I need. I need, well would like as it's just a hobby, an offline version of Wordpress on my PC so I can import my current wordpress site that is online. It's had an old no longer supported theme on it for a couple of years now and I want to change it. But when I preview other themes most of them break the layout. So would like to create an offline version to play with various themes.

Having just typed this I wonder if I could just do it on another part of my website, so it's an online copy and then just play around with the copy. Hmmm.

Link to comment
Share on other sites

I've never used Wordpress before but is it not possible to simply download the files through FTP? As long as you have all the supporting CSS files your layout should stay the same regardless of where your site resides. I don't know if Wordpress uses any dynamic trickery where they load styles from a database but even then you could just view source and copy everything.

Link to comment
Share on other sites

Maybe post some of the errors you're getting so we can assess what you're up against. Who knows, you might just be missing one or two key files...

Link to comment
Share on other sites

Usually the best way to set up a blog to try out themes on isn't to dump the database and import it locally as WordPress stores the site URL in the database and uses that as the base of a number of key URLs. For creating a site to test some themes on it is usually much easier to simply use the export option on the live WordPress to export your posts and pages, then do a fresh install of WordPress locally and import your export.

If your export is large then you may need to gzip the file or split it into smaller files to get past some WordPress upload limits (separate limits to the usual php upload ones).

Link to comment
Share on other sites

Download a Turnkey WordPress VM, export (from your live site) the posts to XML, and your pages to XML, SEPARATELY(some plugins can mess up the export and import process if you do them together, and I've found doing each individually usually fixes the export/import issues). WordPress will prompt you to install a plugin to import the files if its not installed already, and it comes from Automatic.

In your VM, import the XML files. Then, log in to your live site via ftp/sftp/scp, copy your theme and plugins to the VM, enable the theme, the plugins, and make sure all the settings between the two in the admin panel, are the same, widgets, meus, etc. You will have to move the /wp-content/uploads/* as well if you want to keep your media/images working. It will break though if in your pages and posts point to them in long URL format vs relative paths, which you can change in the XML file manually in an editor before importing so all the paths match your LAN URLs vs your live site's. Then go from there.

You could try importing the database from the live server via a MySQL dump, but in my experience, this almost always has some hiccup when importing to wordpress between installs, OS, database versions, etc; something always seems to go wacky, so I use the EXPORT and IMPORT functions of wordpress pages and posts itself, vs a MySQL dump or such. This also usually avoids anything whacked and hidden in the DB you aren't aware of that might also be malicious, since post and page data, is usually benign and mostly sanitized, depending on how old your WP install is.

I have a local copy of one of my sites done this way, and everything is setup the same without having to play with the database itself. The only thing you'll need to change, is disabling Turnkey's inserted footer text (Can be done via CSS, or actually modding the VM's apache files which is permanent vs per theme's "style.css" file - http://www.turnkeylinux.org/forum/general/20090827/footer-powered-turnkey-linux )

VM Images: http://www.turnkeylinux.org/wordpress

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...