Tag Info

Hot answers tagged

28

This is where your problem is: I then edited the resulting .sql file to update all of the file paths and URL references to point to our production site. You can't do that. WordPress stores many options as "serialized data", which contains both the string content of things and their length. So when you modify the URL and the length changes, then ...


12

Your question is a bit specific if you "only" want to automatically import some posts/pages. There are other ways to do this then using a XML export file. If you have text-only posts, then you should use LOAD DATA INFILE. At first you have to export your posts. global $wpdb, $wp_filesystem; $tables = array( 'posts' => array( 'posts', ...


8

First of all you need to find out which hashing algorithm has been used on the Joomla site to store the passwords. Joomla - different to Worpdress - ships with a variety of hashing algorithms. If you have found out how the hashes have been generated, you can port the hashing function over into wordpress and make use of a pluggable function called ...


6

It is that simple for Wordpress too. I use the following to back up my WP sites: mysqldump -u <user> -p<pass> --quick --extended-insert <db-name> > backup.sql The mysqldump document gives the details on all the parameters. --extended-insert is quicker when updating a DB from a dump file and makes the dump file smaller. --quick makes ...


6

how is "already present" defined here anyway (post_id? term_id? name)? The post title and date must match to be already present. The WordPress post_exists() function is used to determine if the post exists. From the plugin code: $post_exists = post_exists( $post['post_title'], '', $post['post_date'] ); The is no filter provided to change this ...


5

Sounds like you have successfully gotten all 300 Pages imported based on the comments. (Regardless of how you did it, either by using the WordPress import plugin or by using some MySQL tool like phpMyAdmin or Sequel Pro or whatever)... You have 300 pages in the wp_posts table. Let's start from here then... The ACF plugin uses the wp_postmeta table to ...


4

If it is an older version of WP, you need to find out what version of WP generated the database, as WP upgrades the DB most times the files are upgraded and you should incrementally upgrade to also upgrade the database. Look in the wp_options table for option 711 and see what the version is; option name will be site_transient_update_core and the value will ...


4

Very likely your settings are there but during your find and replace in sql you may have corrupted the serialised options. If you are doing a mysql dump from site #1 and importing dump to database for site #2, you might want to use my WordPress migration script. Using the WordPress migration script you can have all the options updated with one click, ...


4

Otto's answer is spot-on. I also discovered this the hard way. However, I managed to work around this using a cool script at http://spectacu.la/search-and-replace-for-wordpress-databases/ To migrate your wordpress and to a new url / domain name, do the following: Take a DB dump (e.g. using phpmyadmin) of the existing wordpress Restore the dump as-is, ...


4

To be ON TOPIC on the QUESTION (firefox) i dont think the approach to use delicious as intermediate step is preferred because: you lose the hierarhical taxonomy applied in firefox (they way you structured things) you lose the favicons as gathered in firefox you lose the information added by dividers between links you lose information on the order of ...


4

Allow me to re-introduce 2 things here: (a) "I am not asking how to... I've got that part sorted..." »» I've learnt over time to be OK with the fact that the approach to issues/fixes doesn't necessarily require some 'visible association' with the issue at hand. (b) "...would I have to do to strip out the parts..." "...clients are tradesmen, so even ...


4

I've written a very simple script that is built to do exactly what you're talking about. Here's the basic process you'll want to follow. On the old server, log-in to PHPmyAdmin and export the database. On the new server, log-in to PHPmyAdmin and create your database. You may need to create a new MySQL user as well, but your web host should be able to ...


4

When I use WordPress Import in this cases, this is what I do: Export the XML in localhost. Open the exported file in a text editor. Search and replace http://localhost/wp-content/uploads/ for http://example.com/custom-temporary-folder/. Upload the uploads folder via FTP to the custom-temporary-folder. Perform the Import in example.com using the modified ...


3

maybe you can write 2 functions for your options one script to write a txt file to export your options one script to import in your wordpress (add upload field in your option theme page) all of theses functions can be in your functions.php of the theme here is an example of function to write a ini (txt) file function write_ini_file($assoc_arr, ...


3

You should probably not run preg_replace on the meta data for a _wp_attachment_metadata field as the data is serialized. I would recommend instead you write a small script to loop through the images, unserialize the data, update the value, serialize and store the modified array. Here's a sample function which does just that: function ...


3

Install WordPress as multi-site, choose the option sub-directories. Your main blog will now under example.com/. Create a second sub-site and set its slug to portugueseblog. This site will now be accessible under example.com/portugueseblog. Now import the content from the old blogs into the new one.


3

There are 3 ways you can import content from Word: Paste from Word There's a button in the editor that allows you to paste content directly from Word. This removes the special formatting Word uses to lay content out on the page and will make things work well on your site. (The button is in the "Kitchen Sink" on the Visual editor and is circled in the ...


3

To deal with this issue I always use WordPress Serialized Search & Replace tool provided here. It works perfectly fine. I have been using this for sites. This really take care of the issues with migrating development database to production. http://interconnectit.com/products/search-and-replace-for-wordpress-databases/


3

http://bavatuesdays.com/importing-a-single-wp-blog-to-a-wpmu-installation/ http://sillybean.net/wordpress/migrating-single-wordpress-installations-into-multisite-networks/


3

I think you have two options (third if you find any plugins). I think if you export data from one WP, the users are also copied. The drawback is that you have to import all the content as well. The second option is to export the users from MySQL using PHPMyAdmin. Just export the user table. If you want to include privilidges as well, you have to export ...


3

Answers: Is post_guid the image location reference? Or is the path to the image stored somewhere else? $post->guid is the record in a post which holds the URL for your attachment. Where is featured image set? featured image is saved as post meta so use update_post_meta() once you have the attachment id: update_post_meta( $post->ID, ...


3

The built-in import mechanism can only fetch file attachments that are accessible over the internet - which will normally not apply to your local WP install. The best option is to dump the whole database and do an MySQL import on the receiving domain. Your image files and other attachments need to be ftp-ed to the production server. However, your local and ...


2

This is the answer I alluded to above in my comment. First off, I should say that Andrew's "maybe helpful" piece posted yesterday works, but I didn't end up doing it that way. Either way, you've got to insert records into your wp_users table containing all the ID's of the members you want to import (I also included usernames, but not sure if that's ...


2

I would setup your Website B, add a user through the control panel, then view what tables in the database they were added to and what extra fields were set. Then use Navicat or phpmyadmin to dump users from Website B into excel, combine the users from Website A, set any missing fields then import to Website B


2

If you just need to change the post content, you can avoid the overhead of get_posts/WP_Query by directly querying the database: global $wpdb; $results = $wpdb->get_results("SELECT ID, post_content FROM {$wpdb->posts}"); $total = count($results); $changed = 0; foreach($results as $entry){ $new_content = strip_tags($entry->post_content, ...


2

To copy a WordPress install from A to B, do an SQL dump on site A, and restore it to site B. Then search and replace the DB to swap the old URLs for the new URLs. Make sure to copy over the uploads folder in wp-content. To do the search replace, consider using a tool such as this: http://interconnectit.com/124/search-and-replace-for-wordpress-databases/


2

Have you seen wpshell? It's a command line tool for wordpress. Basically, it's a Wordpress environment that lets you run arbitrary php - so you could set up a WP_Query that pulls all posts, loop through them, and fire that command on each one. Sort of what I had in mind, untested. Using wp_update_post() as it contains the save_post hook, and is the ...


2

You could put this in as a theme page template. This would let you continue modifying your custom code. Whatever you do, avoid plugins that let you put raw php in your posts. It's a huge security vulnerability, and it would let people do things such as submit draft posts containing shell scripts to turn your site into a zombie drone for an attacker.


2

you could use phpMyAdmin to do a search&replace on the wordpress database for the old youtube embed string and then replace with the new one. Should be possible since the syntax is similar enough. edit: to add from this other stackexchange question: Search RegEx is a good plugin to be able to search and replace with Grep through all posts and pages. ...


2

Googling for "split wxr file" returned several results, including python script for splitting .wxr file GUI for splitting WXR files (OSX and Windows) .Net splitter for WXR files Haven't tried any of these, but the comments look positive.



Only top voted, non community-wiki answers of a minimum length are eligible