Question

Photo of Andrew Lee

0

Database Restore

We have a production and a test Rock installation we use.  To help facilitate some of the training we would like to take the data (Primarily all of the people) we have in the production database and move it to our test database.  We use Arvixe as our database/web host.

I did a backup and restore on the database in Arvixe, but after doing this I was unable to login to the Rock.  I had to restore the DB back to the original.

Any ideas on how we can accomplish this?
Andrew

  • Photo of David Leigh

    1

    Andrew,

    Make sure that in the web.config for both the production and test sites, the "PasswordKey" entry has exactly the same value.
    This is used to encrypt/decrypt the passwords stored in the database.

    Unless they are identical, logins from one site will not work with the other site.

    -David.

     

  • Photo of Robert Frisone

    0

    I know this question has been answered but in case anyone wanted to know for future reference I've actually gotten around this before. I would recommend you just backup the web.config file since it would be much easier than the process I went through, but if you're desperate this is what I did.

    I was in a position where I had to reinstall Rock and had a backup of the SQL database. I didn't know about the PasswodKey entry in the web.config file so I didn't think to backup that file before I began. I created a fresh install of Rock and went ahead and updated it to the latest version. We use Winhost as our host and they make it very easy to back up and restore a SQL database. I stayed logged in on the Admin account I made when I installed Rock and restored the database from my backup. Once I did that I just searched for a different account, in this case my old account, and added it to the Administrators security group. I also changed to password on my old account. At this point I logged out and then logged in with the account I just changed. After that I had to use that account to reset all the passwords for the other accounts in the system, including the admin account created when Rock is installed.

    A few things to note about this though. First of all, I don't know how safe this is. Like I said, I didn't really have a choice at this point. It was either do this or retype the entire database. I did this a few weeks ago, and I haven't ran into any problems so far. I also don't know if this will be patched in a future release, but as of 2.0 I was able to do it. This also will not restore your external website, so I would recommend backing it up as well. If you had any assets stored on your server then you will have to restore those too. 

    If anyone else was in the same position I was in hopefully you will find this helpful.