1 matt_mccrady Sep 27, 2005 03:39
3 matt_mccrady Sep 27, 2005 04:07
One problem: it also asks for the DB_Password. I have no clue what this would be. Would it simply be the password I use to log on and edit the site?
4 edb Sep 27, 2005 04:26
Probably not, and that is part of the information contained in your conf/_config file. You typically need a specific password for each database. Are you saying you can't access your database backup, or what? What is asking you for the db_password?
5 matt_mccrady Sep 27, 2005 04:33
In the _config.php file, there are four lines I have to modify:
define( 'DB_USER', '' ); // your MySQL username
define( 'DB_PASSWORD', '' ); // ...and password
define( 'DB_NAME', '' ); // the name of the database
define( 'DB_HOST', '' ); // mySQL Server (typically 'localhost')
When I originally opened the file, the DB_Password was a string of seemingly random characters. I thought, "Well, that must be the password for the database I want to replace (not my old database containing all my blog posts)." So I replaced it with what I thought would be the proper DB password. Only it wasn't. Should I have left that field alone? I can put it back the way it was, if so. I have a copy of the original _Config.php file, but again, this file is for my "fresh" installation of b2 not the installation of b2 which i accidentally deleted.
6 edb Sep 27, 2005 04:49
matt.mccrady wrote:
When I originally opened the file, the DB_Password was a string of seemingly random characters. I thought, "Well, that must be the password for the database I want to replace (not my old database containing all my blog posts)." So I replaced it with what I thought would be the proper DB password. Only it wasn't. Should I have left that field alone? I can put it back the way it was, if so. I have a copy of the original _Config.php file, but again, this file is for my "fresh" installation of b2 not the installation of b2 which i accidentally deleted.
The string of characters is for the database identified in the same file. I currently have 4 installations - each has it's own database name and string of random characters for a password. Since we know you won't be using the old database anymore, it must be the password for the new database. Restore it to what it was and you should be able to see your basic installation. What you're going to do is a bit tricky, so hang with me here a minute.
When I backup my databases I get something like "bvlt1.gz" or "bvlt1.sql" depending on which way I do my backup. That applies to the database named bvlt1. If I want to make the contents of that database go into, for example, bvlt8 database I would rename the file before I attempted to 'restore' the database for bvlt8. Does that make sense? You will want to rename your backup from the old database to match the name that you would get if you were to backup your new database, because we're going to shove the old content into the new database.
Remember to keep a real copy of your original backup on hand somewhere! Tinkering can accidentally lead to corruption, then all bets are off UNLESS you have a known good copy somewhere safe.
7 matt_mccrady Sep 27, 2005 04:57
I think I see what you mean. So if my old backup is named bvlt7.gz, and my new empty database is named bvlt18, I would rename the backup to match the new one. bvlt18.gz Then do a restore? And I would leave the _config.php file alone, right?
8 edb Sep 27, 2005 05:01
Correct! After outsmarting the restore feature that way you will want to run your_domain/install again and tell it you are upgrading. That way the new version will be able to make any changes it needs to the structure of your database in order to work with the new files you have.
Not the content - just the structure. Make sense? If so give it a go and lemme know if it's lemons or lemonade.
9 matt_mccrady Sep 27, 2005 13:03
OK, I did the restore. I went to my_directory/install and upgraded. It seems my blog settings were imported. No posts are showing up, however. And there are error messages saying things like: "WARNING: There are 9 posts attached to inexistant category #11. You must fix the database!"
Have I missed something? I'm choosing the option in "install" that says "upgrade from previous version of b2 Evolution."
10 matt_mccrady Sep 27, 2005 14:02
I'm almost crying from relief: I contacted my host and explained my problem and they restored my directory from a backup. I lost nothing. The email from them came just as I was getting ready for work, and just as I was starting to think I had a day of misery to look forward to as I contemplated my foolishness for having accidentally brought this mess upon myself.
What have I learned: first, don't try to fix something that ain't broken (that's what got me into this mess in the first place); and second, keep good backups. All I had was a database backup, not a full backup of the directory.
Thank you for your help, EdB. You were very generous with your time, and I'll be sure to come back to these forums again, if I ever need assistance with b2.
Easy Breazy! On your PC edit the conf/_config.php file and put the connection info for your existing database, your baseurl, your email id, and set config_is_done to 1. Now upload the whole deal to your server space, then run yourdomain/install and tell it you are upgrading. If you didn't have the current version then you really are upgrading. If you had the current version then it'll figure that out for you. In other words, all you've lost is files so replace the files then tell the d-base (via installing an upgrade) to make sure it's cool with the new files.
What's that you say? You don't know the connection details because you blew up your files without any backup? (Excuse me for a moment while I attempt to hide a rather deep belly laugh... okay - I'm over it now.) No worries! First lay down a raw installation. Now download the new conf/_config.php file so you can verify which database is the new one. Probably a silly step, but knowledge is power and in one sentence I'll ask you to flex that particular muscle. Now restore your saved database on top of the new database and proceed to do the deed to install an upgrade. I'm assuming since you have a database backup you must also have a method to do a restoration. If not that too can be dealt with, but it starts to get a bit geeky.
I'm thinkin' this is pretty close to enough info. Might not be, so don't lose track of your database backup file! It's like the most important part of the whole show, ya know?
(oh man I gotta stop thinkin' 'bout this cuz it's makin' my belly hurt...)
Oh and always wipe out your install folder when done. It's a security thing.
No offense intended, k? Just havin' a bit of fun as I try to help you restore your blog.