Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Importing deleted data back into the data1 table of the database

Hi all ...

I have a situation where data was deleted from a live project (don't ask - it's not been a happy day).  Fortunately, a "download_csv" from the admin module was performed that morning, so, hopefully, all is not lost.  Is there a way where I can safely re-import these cases into the data1 table of the database and have them count towards quotas, etc?  The project is still live, happily collecting data after the untimely reset.

Any help/advice gratefully received.  We are on 8.3.6.
asked Aug 22, 2014 by Marion Bronze (3,360 points)
This is just a comment. Can you add data back into the Data1 table by clicking on the Advanced menu option within the admin module and clicking on the Data1 table? It mentions downloading the database tables but I'm not sure if it means you can edit them? I'm guessing "no"?You may want to test this?
Nah - you can download your data that way, but not upload.

1 Answer

0 votes
I THINK I might have found an answer, but I'm too chicken to try it in the real, live job before I get confirmation from our Sawtooth mates that I'm not doing anything stupid.

I saved my job as a test job, and created a test database.  I then opened up my saved data (the stuff I want to import) and played with the file a bit.  Had to delete the columns at the end holding constructed list results and the like, delete the column row, etc.  I also added 30,000 to each of the respnums just in case.  (There's between 16,000 and 17,000 in the sample so figure that will be safe).  Then I imported my data through cpanel.  And ... oh wonders ... the admin module updated!!  I tried a disqualified case ... all good.  I tried a partial complete - all beautiful.

Gotta be a catch ... can anyone see any reason why it wouldn't work?
answered Aug 22, 2014 by Marion Bronze (3,360 points)
I did same thing in past, and never had problem. I was using v8.2.4.

If anyone has any reason, I would also happy to see.
Cheers!  I've put in a note to support as well, just in case.  It would be good to know of any drawbacks.  Did you follow the same basic plan?  I SOOO need to learn more about databases.
Paul,

You are correct.  For the most part you can just delete the constructed list columns and just import the data back into the table.  Mysql has a CSV importer.  I'm pretty sure that SQL Server does as well.
Thanks for the confirmation, Mike (it's Marion by the way :-))  I was worried that I might stuff up another one of the tables by importing directly into data1.  Glad to see that all should be OK.

Nate also confirmed and recommended, wisely, a backup first.  "With great power comes great responsibility".
I applied the same thing on one of my project. But, couldn't able to re capture the values for input fields (either text or numeric) and for drop-down lists  it is returning the last value by default.

In Addition to that, if you have made any changes in between, within your survey, then you have to match the format of cpanel data table and your data, as the cpanel data table shall have more variables (OLD+NEW).

Any suggestions, most welcome.
...