Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to move a WordPress site to a new server, but I cannot get it up and running on my local server (running XAMPP).

The site is running perfectly fine, but when I download the files, export the database and then hook everything up on my local copy, I get the following error message:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'twentyten_widgets_init' not found or invalid function name in /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/plugin.php on line 405

And the following when I try to access the site's dashboard:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'twentyten_widgets_init' not found or invalid function name in /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/plugin.php on line 405
Warning: Cannot modify header information - headers already sent by (output started at /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/plugin.php:405) in /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/pluggable.php on line 934

Any ideas and/or suggestions?

I have moved many WordPress websites in the past and this is the first time I've seen this error. I am running WordPress 3.2.1.

Thanks!

share|improve this question
    
is your new site loading from coachhousetimbers.com.au/old/ ? That's where WP is looking... –  moraleida Jun 14 '12 at 20:59
    
That's just where I'm trying to install the site locally. –  Leeloo Jun 15 '12 at 1:33

4 Answers 4

Is the site still working/displaying properly , other than this error on the front end?

It looks to me like your new hosting environment has warning and notice reporting ON.

Consider looking in your wp-config.php file for WP_DEBUG and make sure it's set to false.

Depending on how much control you have on your hosting environment, you should contact your hosting provider to adjust the PHP error_reporting to only errors.

EDIT: I would first suggest going into your development location and looking in your wp-config.php file for WP_DEBUG and make sure it's set to true.

The best way to avoid these warnings is to fix them at the source. It's probably a very simple fix - it looks like the function twentyten_widgets_init doesn't exist within your theme, which if you forked the twentyten theme instead of creating a child theme, is likely the case. You may have mistakenly renamed the function without addressing the hook where it's being attached.

share|improve this answer

Try to run this search-replace script as it is able to do proper replaces inside serialized options: Search Replace DB.

share|improve this answer

What you could do is install the WP Migrate DB plugin and add the new server path and site url before exporting the database.

share|improve this answer

Here's the easy way to do it.

  1. Copy all files to your new installation exactly in the order it was in the previous installation.
  2. Download and install Notepad++ if you don't already have it.
  3. Export the db through your phpmyadmin and open the exported sql in notepad++ and press CTRL + H (find and replace dialog box).
  4. a. In find, enter your localhost url, e.g. like 127.0.0.1/mywpinstallation ( remember, no trailing slashes / "http://" or you get everything messed up).

    b. In replace, enter the production url, e.g. myproductionsite.com ( again, no trailing slashes or "http://").

Hit replace all.

  1. Now import the modified sql to your production database, change the db details in wp-config.php and then login to your wp-admin with the same credentials you used to have in localhost.
  2. Go to Settings -> permalink and choose a permalink scheme and save ( do it even if you already have a permalink scheme set.Doing this will rewrite the htaccess for you).

If you have done everything correctly, you should now have a perfectly working production site. Be sure to take additional measures for securing your site. I am not going to discuss that over here.

share|improve this answer
    
lol that was my last answer in stackexchange wordpress. I swear I will be the best leech ever. -1 for answering it correctly? Lawl. –  noc2spam May 14 at 10:40
1  
Most would not consider this a "correct" answer. You have the find and replace backward, and you could corrupt serialized data with a simple text S&R operation. I myself have done virtually what you describe successfully, only when I know there isn't any serialized data to worry about. –  jdm2112 Aug 25 at 15:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.