Lost and Found - Refresh your NetSuite sandbox
If you are a NetSuite administrator or developer, this post will help you avoid a major pain point that others have encountered when managing changes between their NetSuite sandbox and production environments.
Losing new configurations after your NetSuite sandbox is refreshed from production
Many customers that we work with develop in their shared sandbox environment, and then deploy their work to production. Every once in a while, they refresh the sandbox in order to make sure that it is aligned with production. This is important in order to make sure that the development process is based on the most up to date setup. But when a shared sandbox is refreshed from production, all of a sudden all the features that were applied to the sandbox but weren't applied to production are lost. The obvious solution is to back up your work before refreshing the sandbox. But how do you do that?
Through our conversations with NetSuite developers, we learned about many creative ways used to back up sandbox data, from taking screenshots of customizations to copying the SuiteScripts content and re-creating them after the refresh. Unfortunately, all of these methods are manual, time-consuming, and prone to error, leading to a decrease in the amount of refreshes performed.
A new approach to optimize your work on NetSuite development environments
I’m part of the engineering team here at Salto, where we’re building a solution that enables business applications developers and admins to manage and configure their various SaaS applications using code. We created an intuitive structured language that enables text search, re-use of configs and in-line documentation, and added a built-in Git client that allows users to easily audit and document changes, debug and revert to previous versions. This approach enables us to make sure that you can maintain different versions of your sandbox, track changes, compare versions, deploy and, if needed, revert back to prior versions.
Here is how it's actually done in Salto's workspace*:
Salto's Fetch operation connects to the selected NetSuite environment via its API, downloads its current configuration state, and updates the NaCl files accordingly. By clicking on the Fetch button, your configuration is fetched from the sandbox account right before you trigger the sandbox refresh. This way Salto will hold the most updated state of the sandbox account configurations and will be able to restore it right after the refresh is done.
2. Push to Git
The Push to Git operation wraps the changes into a single commit, lets you edit the commit message title and body, and immediately pushes it to Git. The push is made in order to keep the version control updated with every step that is taken in the account, so that you can also revert to a certain point in time or just track the changes that were made throughout time.
3. Refresh sandbox via NetSuite UI
4. Fetch state only
Fetch your configuration from the sandbox account right after the sandbox refresh is done with the State Only flag. This way Salto will be updated with the refreshed state of the sandbox while not applying it to the NaCl files. This approach will enable Salto to calculate the differences between the desired configuration that is represented in the NaCl files and the current state of the account.
Deploy your configuration to the sandbox account to have the same configuration as it had before the refresh.
* Prior to this step you can edit and remove changes that you don't like to deploy back to the sandbox account.
6. Push to Git
As mentioned earlier, the push to Git is meant to make sure that everything is documented so we can audit the changes in the account, and potentially revert back to an older version.
To summarize, Salto enables you to maintain different versions of the configuration, compare and find the differences between them and then deploy. We all know how frustrating developing across environments can sometimes be. We live and breathe it, which is why we wanted to make sure that you will never lose the work you've done in a Netsuite sandbox again.
* The screenshots above were taken from the workspace of our Enterprise SaaS product. Everything I showed is also available in our free open source product