Tag Info

Hot answers tagged

13

There's actually a great function that will do all three of those things for you: media_sideload_image( $url, $post_id, $description ); The first argument is the remote url of the image you want to download. The second argument is the post id of the post to which you want to attach the image. The third argument is optional, but will be a description if ...


11

Hi @ooo: Assuming you want to keep the same domain, it's really quite simple. Basically you copy the files using an FTP client by downloading from the old host and uploading to the new one, and then you copy the MySQL database by doing a database dump to a SQL script (this is your "export") and then running the script (and this is your "import".) The rest ...


9

Put old host in read-only mode Go to WP Admin -> Settings -> Discussion and check "Users must be registered and logged in to comment" Disable authentication: Create a PHP file inside the wp-content/mu-plugins folder, with the following content: <?php function wp_get_current_user() { return new WP_User(-1); } This will prevent all logged-in ...


9

serialize representation can be stored in text and reversed JSON representation can be stored in text but cannot always be precisely reversed Run this example: $query = new WP_Query(); var_dump( $query ); var_dump( unserialize( serialize( $query ) ) ); var_dump( json_decode( json_encode( $query ) ) ); After going through serialize accurate WP_Query ...


7

Here's a very comprehensive guide if someone can help me format it correctly. Sorry, I don't have the time right now to figure out the formatting... A. FTP-copy all theme and wp/upload files from {old_site} to {new_site} Use FTP client to copy from {old_site} to temp folder on local machine Copy from temp folder to {new_site} B. Backup (export) existing ...


6

Yes, use the "import_id" field in the post, when calling wp_insert_post. This is treated as a "suggested" ID for the post that will be used if no post with that ID already exists. $post = array( 'post_title'=>'whatever', 'post_content'=>'whatever', 'import_id'=>123 ); wp_insert_post($post);


6

Codex has decent guide - Changing Site URL. Basically there are several places there URL matter or not so much (I may be missing some): home and siteurl options that control where WP thinks site is; post GUIDs, these look like links but really they aren't - only identifiers. I am not absolutely sure they are irrelevant, but I had URLs change on test stack ...


6

The data you're looking at is not JSON formatted. JSON doesn't (normally) store value types and lengths like that. What you're looking at is SERIALIZED data. A google search for "mysql replace serialized" yields this page, which might help: http://davidcoveney.com/mysql-database-search-replace-with-serialized-php/


6

The main gotcha when changing servers are hard-coded urls and file paths WP. They appear: In the upload path option, under settings / misc (now settings / uploads, if memory serves), on old WP installs. In attachment meta data, on very old WP installs. In your htaccess file, and possibly rewrite rules, if your site lives in a subfolder. In the site URL and ...


6

here is an idea, first add lid to query_vars: add_filter('query_vars', 'lid_query_vars'); function lid_query_vars($vars) { // add lid to the valid list of variables $new_vars = array('lid'); $vars = $new_vars + $vars; return $vars; } then use parse_request hook to create your redirect add_action('parse_request', 'lid_parse_request'); ...


6

Note: The following is largely untested (It worked after testing on one post). As you've pointed out when you edit a post, the plug-in takes the content in the database (HTML) and converts that to MarkDown for editing. Since in your case the content is actually not in HTML, but already in MarkDown, we want to stop this happening. Then by updating the post, ...


5

I asked this question over a year ago, and during that time we've added more people to our team and developed a much larger number of sites in WordPress. I wanted to walk through our process in case it might help anyone else. Everything in Git This was something I was doing even as I asked the question, but it's good to call this point out. Using Git has ...


5

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 ...


5

First off, check if the theme is available in wordpress.org themes: http://wordpress.org/extend/themes/ If it's not, find the name of the theme developer and contact them. Many developers of wordpress.com themes are happy for people to use their themes on self-hosted WordPress blogs. The developer's name and contact details can be found by looking at ...


5

The easiest way to do this is by using copy&replace in the SQL file. Export the database. Use your favorite text editor and do a copy&replace and import it into a new database. Then you go to wp-config.php and you change the WP_HOME and WP_SITEURL to the new host. Then you change the databasename. You also need to ensure that the same db user has ...


5

As others have already mentioned, this can be a long process. But it can also be relatively straightforward, and I've done this to migrate other non-WP sites to WordPress in the past. Export your site First things first, you'll need to export your site from Tumblr into a format WordPress can work with. There are a few tutorials out there on how to do ...


5

As Rarst said above there's only two settings in the database that NEEDS changing. After importing the database I log into PHPMyAdmin and edit the database direct. I use a development server on my PC all the time to import datafeeds and they have the URL attached to the Posts along the lines of http://localhost/testsite/post-name/ and it's never caused a ...


4

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


4

This has been discussed a few times so I'd suggest going over these threads then asking about any gaps you still see. What process do you use for WordPress development? Easily Move a WordPress Install from Development to Production? Ultimately keeping the database in sync is the issue most struggle with. I simply don't really worry about it. I'll import ...


4

It looks like this is now a standard feature on Wordpress.com. http://en.support.wordpress.com/offsite-redirect/


4

If your data is inside database as I understand, it is possible to export your database to CSV file and import this to Wordpress. CSV file is basically a comma separated list of data from your database that makes it possible to transfer data from different database structure to another. It does indeed take some effort to configure your export/import so that ...


4

This is an amazing resource i have bookmarked that I go back to time and time again http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-queries-you-wish-you-knew-earlier/ They state UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = ...


4

I think you want to install your second site on the same database but with a different table prefix, e.g. $table_prefix = "qa_"; in wp-config.php You are then able to define a custom user and/or user_meta table by adding the following lines to wp-config.php define('CUSTOM_USER_TABLE', [orig_table_prefix].'my_users'); define('CUSTOM_USER_META_TABLE', ...


4

There might be hardcoded links in the theme; download it and do a multifile search with a text editor. Editing the text dump destroys serialized data; see another Q/A here: Why is my database import losing text widget data? To correctly change URLs in the database, use the queires below in phpmyadmin for WordPress. You will also need to change URLs in the ...


4

I could be missing something, because I'm not sure why you're talking about using the import functions, but you could download a few older versions from the release archive and upgrade incrementally. Try going to 2.5, then 2.9, then 3.1. If there's some reason you're concerned that won't work, could you provide more details on the situation?


4

Yes, I would say you should upgrade to WP 3.1 instead of importing content in WP 3.1 Like Ian said, you should do an incremental upgrade. I have seen the upgrade working from 2.2.1 to 3.1 directly (Check this tweet) But lets say you should download and over write 2.3 files over your installation. BRowse in your dashboard, it will ask you to upgrade ...


4

If you site is live then you shouldn't directly update that, although update in the recent version of wordpress is very easy and seemless but that wasn't the case in 2.1 though. Also here is the list of steps that I will recommend you to take: Make the list of all plugins. Make sure none of the plugin's are responsible for site's main functionality. (As ...


4

The Chunk theme is currently under review. It has been set as unapproved by the WordPress.org theme review team. If the author makes the corrections it will be available in the WordPress theme repository.


3

The theme may be under review, but it is available via SVN at http://themes.svn.wordpress.org/chunk/1.0/ or via zip at http://wordpress.org/extend/themes/download/chunk.1.0.zip?nostats=1 So you can download it and use it with self-hosted Wordpress.



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