moving wordpress mu to another domain - sql statements - mysql

I'm assuming these instructions are for "normal" wordpress... will this work with wpmu or do i need to modify this? Is there anything i should watch for?
http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/

See Moving WordPress « WordPress Codex and WordPress Serialized PHP Search Replace Tool
The biggest issue you face is changing URLs in the database; and you will need to change these URLs in each of the individual databases that Multisite installs uses. Check out the find/replace tool linked above; it correctly deserializes/serializes data in the database. If you change URLs in a text database dump, or with SQL queries as in the link you listed in your question, you risk breaking data, such as theme options and widget settings.
1/09/2016 Note: WordPress MU doesn't exist anymore. MU was rolled into WordPress core in version 3.0.

Related

Delete Wordpress Post from my .csv URL list

I've got a .csv file with a list of URL I want to delete in my wordpress blog (about 3000 URLs)
Which is the faster way to delete it? I suppose a SQL query, or something like this...
Wise WordPress admins employ plugins for this kind of purpose, rather than hacking away at the MySQL database behind the WordPress installation.
This plugin https://wordpress.org/plugins/bulk-delete/ claims to accept a bunch of URLs to delete.
(Don't forget to back up your installation first.)

Can a separate WordPress (same server) get posts from an existing one, but have different settings?

When developing WordPress themes for a site with a large amount of posts, how can I dynamically pull existing post data from the live version of the site onto my testing site? I already know about WordPress's export feature, but that's one-and-done, not dynamically queried.
Plan A:
Proposed Solution:
Create read-only user in live site's database
PRECAUTION: change test site's prefix from "wp_" to "test_"
Problems:
Settings (like current theme) on test site cannot be changed, thanks to read-only user
No posts found in "test_posts", even though I'd like it to search "wp_posts"
Is there an easier way or existing solution to avoid rewriting WordPress system files on the test site? I'd really rather not rewrite WordPress's database interface...
Similar: Linking themes across WP installations
just duplicate the DB, re-name and call DB in wp-config!

Migrating Widget Settings in WordPress

I've done a lot of WordPress migrations from one server to another at work and elsewhere, but one strange thing I've never been able to understand is why widget settings never get carried over.
I'll dump the MySQL database, find/replace localhost with the live domain, SSH the database up to the live server, and then ftp the whole WP installation (core and theme, from my local machine), and still the widget settings are wiped out. And sometimes this is also the case with values saved in theme options pages I make in the Dashboard.
What am I missing?
Wordpress stores widget options - and some plugins and themes also store their options - as serialized data, and so you have to be more careful than a full find/replace of the URLs.
Much more comprehensive answer and some other ways to do move databases and retain serialized data: https://wordpress.stackexchange.com/questions/9076/why-is-my-database-import-losing-text-widget-data
To move a wordpress site and to reconvert all serialized data I used this script.
the using is very simple, download the script, change the credential variable to the database inside the php script and run it.
link to download the script:
http://davidcoveney.com/575/php-serialization-fix-for-wordpress-migrations/
work fine.
Don't do it manually!
Dont edit database manually when migrating between different domains!
Use small scripts, like this:
Wordpress-Migrator.php (read description too.)
because SERIALIZED arrays needs to be modified specifically too!!!

Wordpress theme editing

Well, I am a newbie with Wordpress.
I just got a free wordpress theme. I want to edit the pages to my customization. I have a shared host which provides MySQL database.
Can I edit this wordpress theme to connect to this MySQL database and pull/push data in to my database?
Is the whole process similar to working with normal php and MySQL? Whats so much difference with the set of php's being a Wordpress theme?
Thanks
Themes are just a bunch of php files which get executed in response to some particular event (basically when a particular kind of page nees to be rendered). You can do whatever you want in them, but everything which is not meant to be "aestethic" should probably be developed in a separate set of custom plugins. You then call those from your theme.
Once you have wordpress installed with the hosting provider and the database connection between the WP installation and the hosting provider MySQL database you can edit your theme through WP itself.
Make sure you set the permissions on the WP-Templates (I think thats what it is called) folder to read/write so that wordpress can write to the template files.
View the following link for any help editing the template. How to edit a WP Template
The theme is just the interfacce of your system, on your theme you only show the data, you need to run a select for instance in the apropriate part, also for the bussines logic.
If you do in the interface, in time your system will mess up.
In the official documentation have plenty of examples and How to's,..
The short answer - there are a number of different templates for the index, search, archive, page and article views of a Wordpress theme. Some themes don't include all of them - certain templates are the default for the other optional templates. You can edit them with software like Dreamweaver or a text editor of you choice, or you can alter them from the Wordpress admin panel.
Wordpress themes are a little too complicated to explain in one simple answer, but I can recommend a tutorial. It's a little dated, but it will explain the overall ideas and it's quite good.
Here's another - I've not read it over but it looks to be well done: http://themeshaper.com/wordpress-themes-templates-tutorial/
A theme is a collection of PHP files along with related files (CSS, JavaScript, images, etc.) that control the appearance of the WordPress site. The content (posts, pages, comments, options, plugin configuration, etc.) of the blog is stored in the database. Any themes on the site are thus separate from the content.
Themes can normally be edited directly from the WordPress admin console. Click on "Appearance" and then on "Editor". You can then edit any of the current theme's files from there. Useful for tweaking things if you know what you're doing, but dangerous in some ways because there's no easy way to undo your changes. Do a backup of your theme before noodling with it.
This entry in the WordPress Codex will help:
http://codex.wordpress.org/Editing_Files

wordpress mu theme per-user options

Is it possible to add an options screen to a Wordpress MU theme (options being saved for each user, so blogwide, not sitewide) ?
I'm used to program wordpress themes, but i'm a bit puzzled as to how make customization happen in a multi-user environment...
Wow, no one answered you after all this time? Okay, here's the answer. If you inspect your MySQL database after you get a few WPMU blogs up and running, you'll notice that each blog has a separate table prefix. The wp_1_ prefix goes to the main admin blog. And then wp_2_ prefix and so on go to all the non-main admin blogs that you create in the wp-admin system. If you want to use the Codex function to access which table prefix, it's actually easy -- just do "global $table_prefix;". In fact, as a side note, WordPress emits a ton of global vars that are quite useful and you can find out what these are by doing "print_r($GLOBALS);die();" in like a plugin or theme file.
But anyway, the answer to your question is that if you look into the MySQL database, you'll find that each blog in WPMU gets its own options table, and it is separate, not sitewide, but blogwide -- just as you desired. And when you use the standard WordPress options API, it will access the options table you need automatically without you having to use the $wpdb global object and without you needing to use $table_prefix global string.
So, if you are using get_option(), update_option(), add_option(), and delete_option() -- these will all work still in a WPMU environment. And even though the plugins folder is shared among all blogs, a plugin's settings are not and are exclusive to each blog.
Now, if you are not using the WP Options API in the Codex, but are going at it with the $wpdb global object, then you'll need to be aware that you'll need to address tables by the $table_prefix global string as part of the table path. There are some cases where this is desirable, such as having a LOT of data that you need to store in a custom table. For instance, storing HTTP_REFERER and user agent info into a table for connections coming in.