Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Converting Lua Upgrade Scripts to Python Data Migrations
To convert migrations (a.k.a. "upgrade scripts") that were originally written in lua we need to get the version that the migration upgrades from, the object type the migration is written for, and lastly convert the code into python code using the [decorators](Decorators.md) described previously.
To convert migrations (a.k.a. "upgrade scripts") that were originally written in lua, we need to get the version that the migration upgrades from, the object type the migration is written for, and lastly convert the code into python code using the [decorators](Decorators.md) described previously.

## Example
Assume there are two versions of a lua toolkit, 1.0.0 and 1.1.0 where the 1.1.0 version is following the basic toolkit directory structure (actually containing all operations):
Expand Down Expand Up @@ -53,4 +53,4 @@ def upgrade_linked_source(old_linked_source):
return new_linked_source
```

You will need to determine how far back in the lua upgrade chain you want to support multi-step upgrade from, and convert all of the upgrade scripts accordingly. Remember that the execution of these scripts rely on there not being any missing migrations, and will be executed from the lowest version that exists to the highest version.
You will need to determine how far back in the Lua upgrade chain you want to support multi-step upgrade from, and convert all of those upgrade scripts accordingly. Remember that the execution of these scripts relies on there not being any missing migrations from the `minimumLuaVersion` defined in the plugin config to the last toolkit version written. Lua migrations will be executed migrations from the lowest to highest version that exists. When executing, these migrations are run to the highest Lua toolkit version only. Any migrations needed to get from that toolkit to the Python plugin would need to be written as a regular Python migration.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Before the Virtualization SDK was written, Delphix only supported toolkits written in Lua. There was only limited documentation to help people write, build, and upload toolkits. Multiple toolkits were released and are still used by customers today, so as we move towards only supporting SDK Plugins, there must be a way to get customers off of Lua toolkits and onto SDK plugins.

If you are reading this and have no idea what a Lua toolkit is, there is no reason to read further into this section. Everything written in these pages will assume the goal is to write specific code as part of a plugin to be able to upgrade objects that were created using old toolkits into objects in the Delphix Engine pointing to a plugin.
If you are reading this and have no idea what a Lua toolkit is, there is no reason to read further into this section. Everything written in these pages will assume the goal is to write specific code as part of a plugin to convert objects created using Lua toolkits to use the newly uploaded Python plugin.

In the next few pages, we also make the assuption that you've written both a Lua toolkit and a python plugin before and know some of the terminology already established. If this is not true, please try [building a plugin](/Building_Your_First_Plugin/Overview.md) and [writing some upgrade migrations](/Versioning_And_Upgrade/Upgrade.md) first before coming back here to learn how to add upgrading from Lua toolkits into the mix as described below.

Expand All @@ -17,4 +17,4 @@ The other way to migrate from a Lua toolkit to a plugin is to wait and write a p
Having the ability to define Lua upgrade operations in the new plugin code means that older Lua version migration scripts can be [converted](Converting_Migration_Scripts.md), enabling multi-step upgrades from older Lua versions to migrate and become plugins.

!!! warning "New versions of a Lua toolkit is strongly discouraged after Python Plugin is written"
After having written a Plugin to migrate a specific Lua toolkit, while possible, you should avoid writing new major/minor versions of the toolkit in Lua. Patch releases with no schema changes can still be done. If you need to write a new Lua toolkit version please contact Delphix Support to get help on updating migrations accordingly.
After having written a Plugin to migrate a specific Lua toolkit, while possible, you should avoid writing new major/minor versions of the toolkit in Lua. Patch releases with no schema changes can still be done. If you need to write a new Lua toolkit version please contact Delphix Support to get help on updating migrations accordingly.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Plugin Operation | **Required** | Decorator | Delphix Engine Operations

## Lua Repository Data Migration

A Lua Repository [Data Migration](/References/Glossary.md#data-migration) migrates repository data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format.
A Lua Repository [Data Migration](/References/Glossary.md#data-migration) migrates repository data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

### Required / Optional
**Optional.**<br/>
Expand Down Expand Up @@ -70,7 +70,7 @@ def add_new_flag_to_repo(old_repository):

## Lua Source Config Data Migration

A Lua Source Config [Data Migration](/References/Glossary.md#data-migration) migrates source config data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format.
A Lua Source Config [Data Migration](/References/Glossary.md#data-migration) migrates source config data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

### Required / Optional
**Optional.**<br/>
Expand Down Expand Up @@ -124,7 +124,7 @@ def add_new_flag_to_source_config(old_source_config):
```
## Lua Linked Source Data Migration

A Lua Linked Source [Data Migration](/References/Glossary.md#data-migration) migrates linked source data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format.
A Lua Linked Source [Data Migration](/References/Glossary.md#data-migration) migrates linked source data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

### Required / Optional
**Optional.**<br/>
Expand Down Expand Up @@ -178,7 +178,7 @@ def add_new_flag_to_dsource(old_linked_source):
```
## Lua Virtual Source Data Migration

A Lua Virtual Source [Data Migration](/References/Glossary.md#data-migration) migrates virtual source data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format.
A Lua Virtual Source [Data Migration](/References/Glossary.md#data-migration) migrates virtual source data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

### Required / Optional
**Optional.**<br/>
Expand Down Expand Up @@ -232,7 +232,7 @@ def add_new_flag_to_vdb(old_virtual_source):
```
## Lua Snapshot Data Migration

A Lua Snapshot [Data Migration](/References/Glossary.md#data-migration) migrates snapshot data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format.
A Lua Snapshot [Data Migration](/References/Glossary.md#data-migration) migrates snapshot data from an older [schema](/References/Glossary.md#schema) format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

### Required / Optional
**Optional.**<br/>
Expand Down