LimeSurvey 7 Major Version Upgrade
From LimeSurvey Manual
Major Version Upgrade - LimeSurvey 7
LimeSurvey 7 introduces a major cleanup of how response tables and fieldnames are generated. This update modernizes long-standing internal naming conventions and creates a more predictable and robust foundation for plugins, integrations, and future development.
Because this is a structural change, any custom work that relies on old naming may require updates. This page explains what changes, how to test safely, and how to prepare for upgrading.
1. What changes
1.1 New table names
LimeSurvey now uses a consistent naming scheme for response-related tables.
| Old table name | New table name |
|---|---|
old_survey_<sid>_<timestamp>
|
old_responses_<sid>_<timestamp>
|
old_survey_<sid>_timings_<timestamp>
|
old_timings_<sid>_<timestamp>
|
survey_<sid>
|
responses_<sid>
|
survey_<sid>_timings
|
timings_<sid>
|
Any SQL queries, integrations, or plugins referencing these tables may require adjustments.
1.2 New fieldname structure
Fieldnames now follow a predictable and consistent format. Examples:
Q<questionId>- root questionQ<questionId>_S<subquestionId>- subquestionsQ<questionId>_C<suffix>- comment or other fields- ranking fields:
Q<qid>_R<aid> - timing fields: question-level or group-level depending on context
This replaces the legacy sidXgidXqid based naming.
2. Why this matters
This cleanup addresses naming patterns that were formally defined and used over many years and brings them into a consistent and robost structure we can build on for the future.
Structural changes like this are rarely simple. They touch parts of the system that many plugins and integrations rely on, which is why they are often postponed due to their complexity. But keeping things consistent and predictable is important for long-term stability.
By addressing this now, we make LimeSurvey cleaner and easier to extend, even if the change is mostly invisible on the surface.
3. How to preview new fieldnames
To see how any existing fieldname will map to the new LS7 structure, you can perform the following steps:
- Backup the database, as the changes are not reversible and if it goes wrong, it will be useful to have the database prior the change to recover
- Checkout the tablename/fieldname refactor epic:
git checkout epic/LE-33-tablename-fieldname-refactoring
or to clone/download the project directly at this branch at https://github.com/LimeSurvey/LimeSurvey/tree/epic/LE-33-tablename-fieldname-refactoring - Load an admin page to trigger the change script
- Report any error you may get during the execution of the change script
- Study the new tablenames and fieldnames
- Test your plugins/themes and fix errors related to tablenames and/or fieldnames
The function used to convert old fieldnames into new fieldnames is the following:
getFieldName($tableName, $fieldName, $questions, $sid, $gid, $cd)
Parameters
- $tableName - original table name
- $fieldName - original fieldname
- $questions - root question and its subquestions
- $sid - survey ID
- $gid - group ID
- $cd - whether condition designer logic applies
Result
The function returns the new LS7 fieldname for that response field.
4. How to test the changes safely
It is strongly recommended to test LS7 in a dedicated environment before upgrading production systems.
4.1 Install LS7 in a separate environment
Download the latest LS7 beta from:
https://community.limesurvey.org
Install it separately from your current setup.
4.2 Import your existing assets
Test using:
- surveys
- survey themes
- admin themes
- question themes
- plugins
- custom JavaScript
- any custom integrations you have built
- or anything else you might worry about.
Check if everything works as expected with the new table and fieldname naming. Update any code that relies on the old naming.
4.3 How to Trigger the migration?
If you want to preview the migration logic in your test installation:
- Back up your database.
- Install the LS7 beta build.
- Load any admin page to run the migration script.
- Review table and fieldname changes.
- Test the application.
- Update custom code if necessary.
4.4 Report issues
Thanks for testing this early. If you spot anything that looks off from the core, please report it so we can fix it as soon as possible.
5. What may require updates
The following may need adjustments:
- plugins referencing old fieldnames or table names
- any custom integrations you have built
- JavaScript using fieldname based selectors
- custom themes interacting with response related identifiers
- integrations dependent on the previous naming scheme
- importing old exports such as survey, themes, question themes etc.
This is expected and part of the upgrade process.
6. Summary
- LS7 Beta 1 introduces a complete cleanup of response table and fieldname naming
- This is the primary structural backend change for LS7
- Testing in a separate environment is strongly recommended
getFieldName()helps preview future naming- Update custom code where required
- Report issues early to help stabilize the final release