Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Separate but identical development and production systems with LS

More
8 years 10 months ago #120136 by adamd
Dear Community,

We are happy users of Limesurvey, but are facing an issue in maintaining development best practices, so I was wondering if any of you could solve this somehow.

We have a complex system, and part of that is a survey loaded from LS. We have a separate development and production version for the whole system (separate virtual machines, web server, database, etc.), and we only put into production what we have tested and verified in the identical development environment. The problem we couldn't find a good solution to is how to transfer the questionnaire structure from dev to prod without any changes.

We can export the structure on dev and them import it on prod, but then the question IDs change, and all the URLs linking to specific questions (e.g. filling in hidden fields automatically) break as well. Another thing is that if we just make an incremental change in dev (e.g. add a new question), can we transfer that change without wiping and re-creating the whole questionnaire in the prod environment?

Does any of you use LS in an environment like this, maybe doing all this automatically, as part of your CI process?

Thanks a lot,
Adam
The topic has been locked.
More
8 years 10 months ago #120142 by Ben_V
Hi Adam,
One solution is to overwrite your "dev" database with the current "prod" database before starting a new survey development
(sql export via phpmyadmin with setting option "drop tables if exist" )... Like this everything should be ok when you'll import your new survey structure.

You can avoid to reimport answer & token tables unchecking those tables before exporting... or with a custom sql script...

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
More
8 years 10 months ago #120519 by adamd
Hi Ben,

Thank you for the quick reply. I'm not entirely sure that would work - let's say I do this synchronisation in the beginning, then create 3 surveys in the dev database, but only move 1 to the prod (because the other 2 turned out to be useless). Wouldn't this mean that question IDs get immediately get out of sync?

The other thing I'm trying to understand if I can somehow keep an existing survey in sync between the two services. Let's say there's an initial version of the survey that gets transferred from dev to prod, but later we need to add two new questions. Is there a way to deploy this "incremental update" without deleting existing answers?

Thanks,
Adam
The topic has been locked.
More
8 years 10 months ago #120521 by Ben_V
1) No, this won't works in all cases... I suppose this only will work if the useless surveys are the 2 last ones... and if you've not add a question to survey #1 after the creation of surveys #2 and/or #3

2) No way! The big problem is not the only the sync; You cannot add or delete a question (or add an answer option) to an active survey (only text edition is allowed). To add a question you have to (more or less):
- export/backup submitted answers ( .VV file )
- desactive the survey
- create the new question
- create manually (using a text editor) the missing column (corresponding to the new question) into the saved file containing the answers...
- reactive the survey
- import the answers


So the good way is avoiding the use of group or question IDs in your survey. Often you can use placeholders instead:
survey ID=> {SID}
(this)group ID=>{GID}
(this)question ID=>{QID}
{SGQ} => {SID}X{GID}X{QID}

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
More
8 years 10 months ago #120531 by adamd
Yes, that was the only method I knew for editing a live survey, though I hoped there might be a better solution.

The reason why I'm interested in the question ID is because we use parameter passing to connect the LS database to our existing infrastructure. Basically a user that is already logged in reaches our LS site from our website, and we pass the user ID into a hidden field so that the users don't need to fill this in again. We use the {SID}X{GID}X{QID} format for this, so our links when calling the survey look like this: /_limesurvey/index.php?r=survey/index/sid/832147/lang/en/newtest/Y/832147X514X11112/{user_id}

Is there a better way of doing this, something that doesn't rely on the group/question ID that's changing across instances?

Thanks,
Adam
The topic has been locked.
More
8 years 10 months ago #120535 by Ben_V

Is there a better way of doing this

Sorry it's also the only way I know... Maybe another LS user will share other method :unsure:

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120549 by DenisChenu

adamd wrote: Is there a better way of doing this, something that doesn't rely on the group/question ID that's changing across instances?

Use directltly question code if your instance are uptodate.

manual.limesurvey.org/Workarounds:_Surve...using_the_survey_URL

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose