Forums

[resolved] Reinstalling from scratch, but keeping the existing mysql DB/data... (5 posts)

  1. zigguratbuilder
    Member
    Posted 1 year ago #

    Hi all: Bizarre problem here.

    I'm getting the "Cannot modify header information - headers already sent by..." messages, and can't log in, etc. Problem is, the error is not actually on the files in question, it's on the files *calling* those files.

    Ex: I was first getting errors (in two locations) about two different files. One of them was "wp-config.php: Line 1". I confirmed over and over again that there were no problems on that file. However, after exploring my blog's root dir a bit, I found that (after my host ran a script through everyone's files) other files had spaces after the ending "?>". So I went around editing other files, removing spaces after "?>", and each time I changed a few files, I noticed that the error location changed: xyz.php line 1 to xyz2.php line 2 to xyz3.php line 1, and so on.

    So as best I can wager, in some of my files - somewhere - in out of hundreds of files, I have these "whitespaces after the ?>". Yuck.

    Anyway, instead of going through every single text file, I went ahead and overwrote (upgraded) my wordpress to the latest: Problem is, the issue persists. Whatever files have these whitespaces, they're generated files, not files in the wordpress zip...

    So, I guess what I'm looking to do is a complete reinstall of this wordpress instance, from scratch (not an upgrade): But I want to keep and use my existing mysql DB, I don't want to overwrite/clear it.

    How do I do this? IIRC, if I go through the normal installation process (that is, completely delete all WP files, go through the default setup webpage) it will ask for my db/password, then *recreate* the tables, blowing away my existing data.

    Is there an easy way to do this? Or is my best bet:
    * Back up my mysql db
    * blow away WP files
    * blow away WP DB
    * install WP files from scratch, new install
    * Go through install process to create a new db
    * then overwrite the new db by restoring the old DB

    Thanks-
    Andy

  2. Chris_K
    Member
    Posted 1 year ago #

    One option -- save your current wp-config.php file. If your theme isn't the default you should probably back up a copy of it as well.

    Blow away all the other WP files.
    Upload new WP files.
    Restore that backed up wp-config.php file

    Done!

    No need to run the WordPress install since you already have a functioning database.

    Now, assuming everything works as expected you can methodically start re-installing plugins and themes -- but test after each install. Hopefully that will help you narrow down where the issue lies.

    Or, skip the re-install. Instead, deactivate all plugins and set the theme to default or classic. Test. If it works properly, again with the methodically add / test routine.

  3. zigguratbuilder
    Member
    Posted 1 year ago #

    >>>>>
    Or, skip the re-install. Instead, deactivate all plugins and set the theme to default or classic. Test. If it works properly, again with the methodically add / test routine.
    >>>>>
    Ah, unfortunately due to the issue I cannot log into my own site, so I have to use a heavy hammer solution. I'll try the wp-config.php option.

    Thanks, will post results in the next 24 hours.

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    renaming plugin folder, and active theme by ftp would deactivate plugins and theme

  5. zigguratbuilder
    Member
    Posted 1 year ago #

    Hey Chris_K, thanks for your help. That was relatively painless.

    Bizarre thing, though: After all of that, and clearing away all the whitespaces in all the files, it seems that there was still some sort of problem with the original wp_config.php file. After scouring it (it's only like a dozen lines!) a few times with no success, I just pulled the wp_config from another one of my other installs and replaced the password, DB etc fields.

    Anyway, my blog is back up (tenra-rpg.com/blog) and running with minimal outage. Now I'm off to trawl through some new themes. Thanks again!

    -Andy

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.