windows crash with wamp
Posted by: egoph (---.bredband.comhem.se)
Date: June 14, 2016 12:56AM

I had win7 with an earlier Wamp and Wordpress. So the PC crashed....totaly
Luckily I had a backup sql file for my local website
Now I have installed the latest Wamp on Win10 and got the green icon.
So I made a PHP databas.
Then I instaled Wordpress and named the folder as the databas. Set up the WP config file and connected to the database.

Then I tried to import the securityfile but only get an error #1062 - Duplicate entry '1' for key 'PRIMARY'

I am not sure what to do. Hope for help..

Options: ReplyQuote
Re: windows crash with wamp
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 15, 2016 12:35AM

First - your subject line is completely wrong. Windows did not crash - you did not get a BSOD - Blue Screen of Death, you just got an error message from some component executing on your computer - I say it is an SQL error.

Reading your subject line, people are going to think that you mean that WAMP caused Windows (the operating system) to crash completely.


Second - go read this page: [stackoverflow.com]

Is what you showed

"#1062 - Duplicate entry '1' for key 'PRIMARY'"

the complete error message or was there more - always give every bit of an error message, something that might seem unimportant to you may be key to getting the correct answer to your problem.

And third -

The information you provided is not sufficient for me to form a good picture of what you did and make concrete suggestions to resolve the issues.

I've never used WAMP on Windows 10 so you might want to post a new question "Will WAMP run under Window 10?" and see what the replies are. You might need to change something, but I don't know.


Let me go line for line on some of what you said and ask some questions:

You said: "So I made a PHP databas"

What did you make - a MySQL datbase named databas (using myPHPAdmin), a PHP file named databas, a directory named databas - what??

.
You said: "Then I instaled Wordpress and named the folder as the databas."

How did you install Wordpress and into what directory did you install it? Did you download WP from wordpress.org and install it? Where did you installed - give me the exact, fully qualified Path on your computer to the directory where you installed WP. Did you name the directory databas before you installed WP or did you change it afterwards.


You said: "Set up the WP config file ..."

What did you "set up in the WP config file (I'm assuming it was the wp-config.file - right?) what did you insert or change - show me the changes or insertions, please.

You said: "...and connected to the database."

What does that mean, what steps, all of them, in detail plese, did you perform to "connect" to the dabase?

You said: "Then I tried to import the securityfile but only get an error #1062 - Duplicate entry '1' for key 'PRIMARY'

What is "securityfile"? Where were you importing it from and where were you importing it to and what do you mean, exactly, when you say "importing."

Give me answers to those questions and I'll see if I can be of assistance in fixing your problem.


[stackoverflow.com]

Options: ReplyQuote
Re: windows crash with wamp
Posted by: egoph (---.bredband.comhem.se)
Date: June 15, 2016 12:33PM

Simon,Thanks for Your explaining answer.
You are right about me, not expressing me so well(really bad actually)
I will use some of Your advises but first I will explain me better.
Its all about a rather big local site(much work)

Before all my trouble I made a security-copy of my website(sql within phpmyadmin)
All in win7 with an earlier WAMP. Had Wordpress too
Then my OS crashed. Lost all programs and settings. Had to reinstall a clean win7 and made an upgrade to win10 at the same time
Reinstalled WAMP with newest 32 bits paket. Got Green icon

Made a new database in Phpmyadmin with same name as the database which was backed up.
Installed Wordpress C:wamp/www/same sitename as the old database and set wp-config file(did'nt remember my password for the security database so I made new names and password
Got problems with path to my site. Made changes in my Wamp-settings.
It ended up with "add local host in url. But I know I should change it to virtual later
Got contact with the instalprocess and upgraded the new database with Wordpressettings
So now I have a clean Wordpress database.
Then I made an import of my security database(sql) but got conflict #error 1062
I red some of the advices in stackoverflow but I was still unsure what to do.

So I did a new database with Phpmyadmin (no tabells) and imported my site-backup to a databse with the same databasename as before.
It went well. Everything is there. Of course the user id is different to what I registered in wp-config for the new WP database

But now I am unsure how to go further....
I have a new wordpress-site witch is in function but not with my old settings and data
I have my old website in a database but cant get it run with WP.
Hope this is a more faire explanation....

Options: ReplyQuote
Re: windows crash with wamp
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 16, 2016 09:17AM

I still some queswtions - I still don't understand what you refer to as "the securityfile"

Do you mean a copy of the MySQL file from the old WP installation? If not, what???

You also said

"Before all my trouble I made a security-copy of my website(sql within phpmyadmin)"

Why do you use the word "security" - do you mean a backup as "security" for something going wrong - like your system crashing?

"sql within phpmyadmin" - if you made a backup of the WP DB using phpMyAdmin, it only backed up the DB, it did not backup the WP files.

"I have my old website in a database but cant get it run with WP"

You do not have your website in a database. A WP website is made up of the WP files (as downloaded from wordpress.org and then installed somewhere) AND the MySQL database. As new versions of WP are developed, they may alter the DB struture and when the new release is installed, the DB will be updated.

A copy of a DB used by an old version of WP may not be compatible with a new version of WP and you may not have any way to update in a situation as you are in - where did a complete computer system installation because of a "crash."

If I am reading between the lines and interpreting things correctly - you now have a working WP site but it is with a "virgin" DB -- that is, the only users, posts, comments, etc. that were "on" the old WP site - with the old database - are not present in your recent WP installation - is that correct.

BEFORE going any further - I need to know if you have a copy of the database used by the WP installation you lost when your system crashed.

If so, how did you create it - in detail, please?

What is the backup on, a CD, etc?

When you said, in the original post:


"Then I tried to import the securityfile but only get an error #1062 - Duplicate entry '1' for key 'PRIMARY' "

Were you using phpMyAdmin, running under WAMP, to try and import an export file of the old WP database which was created with the version of phpMyAdmin you were using when the backup was made. Was it during the import that the error occured?

Where were you trying to import the export copy of the old database - to the database for the WP installation had just done?

OR - did you get the error after importing an exported copy of the old database into the new WP database and you tried to use WP?

Were you going into the WP site via a browser when you got this error?

Answer those questions. I have already written a very, very long reply to you but as I was proofreading it, I realized I was missing a piece or two of the puzzle which would affect the suggeswtions I would make.

If received that error message during one of those two steps, you might be able to recover, maybe:

1 - Start phpMyAdmin.

2- rename the database being used by the working WP site, put BACKUP on the end of the name.

3 - create a new database with the same name, user, and password as the one you just renamed.

4 - using phpMyAdmin, import the backup export copy of the old database to the new, empty database.

Go to the WP site. Let me know if you get errors at any point in these steps and what you were doing and the exact text of the messages.

I think - I could be wrong - that the error message you got was phpMyAdmin or part of WP telling you that there was already a user record in the wp-user database table for a user number one (1). That is the number of the default Administrator created when you install WP.

When you created a new database and installed WP, and then tried to import the old DB into the new DB, there was another user record created, phpMyAdmin attempted to create, with user number one (1) - it was the user record for the administrator in the old database.

That is, the database contained a user with user number one (1) after you installed. When you had phpMyAdmin import the copy of the old database, there was a user number 1 in the copy of the old database. I think that field in the DB is set to "must be unique" and that is what triggered the error message.

If you go the message trying to run WP on the site, it may have checked for duplicate numbers.

The more I think/type about this the more certain I am that the error occurred during the phpMyAdmin import function.

Regardless, by importing the old database into a new, empty one, you might lick this problem.

HOWEVER - if the version of WP you were using when you exported the database, before your crash, is very old, compared to the version you just installed, the databases may not be compatible.

But - do the steps above and see what happens.

To fall back to where you were - delete the new database and remove the BACKUP from the name of the database your renamed.


NOTE - I just realized that sometimes I am typing database and at others DB - they mean the same time. I use them interchangeably.

Try this and let me know what happens:

If you don't understand any part of the steps, above, ask me before you do anything of them.

Better to clarify the steps than to try and recover from what might be a bigger mess.


If you get your site backup and running - or simply continue with the new site you have working without your old database - you need to install the Duplicator plugin and use it to make backups of both the WP files and the database, before you change anything and after you changes things if you are going to keep the changes.


I've been in computers since 1973 and I don't do anything without a backup!

I harp at my clients to make backups of everything and to store backups off-site so if their building burns done, they will be able to stay in business, albeit with some delay while they find a new location and get new equipment.

For a business to lose all of its records to a computer crash or other disaster can mean the end of that business.

Even if you are not using your computer for commercial purposes, you need backups so you can recover from the mess your crash left you in.

Do what I suggest above and tell me what happens.

Options: ReplyQuote
Re: windows crash with wamp
Posted by: egoph (---.bredband.comhem.se)
Date: June 16, 2016 07:04PM

The way You explain was the way I did when I got the Error message: #1062 - Duplicate entry '1' for key 'PRIMARY'
I followed Your advice and got the same reaction(error)

I think the old database has a different user and password and therefore I get this error.
Can't I do like this:
Import the backup to a totally clean new database.
Then I delete the User line totally and Export it as a new backup.

Now I go to the database with only my owner and password(set from the latest wp-config)
Then I import the back up the one without any User.
What Yoy say?

Options: ReplyQuote
Re: windows crash with wamp
Posted by: egoph (---.bredband.comhem.se)
Date: June 17, 2016 10:31AM

Simom I have got an solution:
First I imported the backup to a new empty DB
Then I saw the username and the name of the site and also the old path.
Now I deleted the password.

Then made a new DB clean one and named it as the pathname in the backuped one.

Went to my wordpressfolder and gave it the same sitename as in the backup.

restareted wam with wampsettings for add localhost in url.

Went to WP's installing process www/sitename /wp-admin/install something

Gave the WPsite the same name as the backup and the same for username and left the password blanc.

Then I went to the DB för the backup and change the path so it got a level more.

Then went to Wamp's local host and started the site and viola...! It made the deal.

Thanks for all Your help- I really appreciated it- You helped me be a bit more clear in my thinking.

This problem is solved!

Options: ReplyQuote
Re: windows crash with wamp
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 19, 2016 01:34AM

You are welcome.

It's great to hear you got it running.

NOW - go get the Wordpress Duplicator plug-in, install it, and down the Package files to somewhere on the local HDD - Duplicator shows you two buttons when a Package is created.

Clicking one button downloads the Duplicator installer.php file which you "run" to restore the Package.

Clicking the other button downloads an archive (a zip in the version of Duplicator I have - the latest version, I update it as soon as I know there is a new version). The archive/zip file will contain everything that is in the WP root directory - all of the WP files and theme files, etc. etc. AND it will contain a copy of the database as it was at the time the Duplicator Package was run.

Do this regularly as you make changes to WP and as new posts, comments, etc. are created.

Then, if you lose everything again make changes and get errors you can't resolve - you can restore the latest Duplicator Package and be back to exactly where/when you were when you made the Duplicator Package.

Duplicator can be a tad confusing the first time you use it to restore a package but you can figure it out.

You've gotten backup and running - do not neglect to make backups!!!!!!!!!

Backups of the entire WP site, not just the database.

Again - If you restore a Duplicator Package, the site will be EXACTLY as it was when you ran Duplicator to create the Package.

It at least gives you a working site as a starting point to put make any changes that were made after you made the Duplicator Package and before any new problems occur.

BACKUP - and don't backup only WP. Backup other things on your computer.

Options: ReplyQuote
Re: windows crash with wamp
Posted by: egoph (---.bredband.comhem.se)
Date: June 19, 2016 02:46PM

Hi!,
Is it this one You mean

Duplicator / Cloner / Migrator *** PRO features for FREE ***

Options: ReplyQuote
Re: windows crash with wamp
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 20, 2016 01:06AM

Is the one described on this page:

[wp-mytake.com]

it is the one.

I found it by going to my WP Admin Dashboard (Admin Window_, clicking Plugins and then Add New and then I put Duplicator in the the Search Plugins box at the top right hand side of the Dashboard window and pressed Enter.

If it is the one I referred to above, go ahead and install it and then run it to make a Backup/Clone Package that can be used to restore WP or move it to a different directory or even a different server. It will backup the entire WP directory AND the MySQL database.

Had you had one of these Packages when everything failed on you, you could have gotten your computer back up and running, installed WAMP, etc. as you did and:

Then you could have created a directory under the wamp www directory for your site, put the Package files in that directory and "run" the installer.php file.

After you provided some information - that can be a tad confusing the first time - you would have a copy of the WP site and database exactly as it was when you created the Duplicator Package.

If you then created a virtual host for the WP site, you could have entered the virtual host name in your browser and, Presto - WP is exactly as it was when you make the backup.

That should sound a lot better than what you actually had to do. To be safe in the future, do frequent backups (depending on the volume of changes in the database or any configuration changes in WP) and copy them to CDs so that if the system crashs, or goes up in smoke, you'll have a WP backup that you can use once you replace the computer.

Any changes, to anything with WP or the database, that were made after the backup Package was made would be lost when you install a backup, but at least you are back up and running at some specific know state.

By the way, when I use the word "Package" I am using it because that is the way Duplicator refers to the backups it creates.

As you install any package or program - WP or even WAMP, keep notes of what changes you make or procedures you use - such as how you created a virtual host.

Those notes will be invaluable as you reinstall after a disaster. Don't try to remember every change or evrery step you performed with something like WAMP. Make notes, print them, and put them somewhere safe.

You could, of course, make notes in a text if eon your computer but what if you lose the entrie system again??

Post any questions you have.

Options: ReplyQuote


Sorry, only registered users may post in this forum.