def __init__(self): mforms.AppView.__init__(self, False, 'db_copy', True) self.background = None if platform.system() == 'Windows': self.set_back_color(mforms.App.get().get_system_color( mforms.SystemColorDisabled).to_html()) header_back = mforms.newPanel(mforms.FilledPanel) else: header_back = mforms.newPanel(mforms.StyledHeaderPanel) header_back.set_back_color("#ffffff") header_back.set_padding(8) self.header = mforms.newLabel("") self.header.set_style(mforms.WizardHeadingStyle) header_back.add(self.header) self.add(header_back, False, True) self.set_back_image( mforms.App.get().get_resource_path("migration_background.png"), mforms.TopRight) self._ui_created = False self._page_list = [] self._page_trail = [] self._current_page = 0 # Load current user numeric locale: locale.setlocale(locale.LC_NUMERIC, '') self.plan = migration.MigrationPlan() self.create_ui()
def test_script_full_mssql_migration(self): # Sample migration plan: plan = migration.MigrationPlan() # Each migration source instance needs a concrete connection to the server with the source database: source_server_instance = grt.unserialize( './fixtures/mssql_connection.xml') self.assertEqual(source_server_instance.parameterValues['database'], 'AdventureWorks') plan.setSourceConnection(source_server_instance) # Each plan must set a migration target plan.setMigrationTarget( 'MySQL') # a string with the name of the instance to be used # Now reverse engineer the source catalog: plan.migrationSource.reverseEngineer('AdventureWorks') # Proceed to the actual migration: plan.migrate( ) # Now the target should have been populated with the migrated objects # Get the resulting MySQL script: script = plan.migrationTarget.generateScript() self.assertIsInstance(script, str)
def __init__(self): mforms.AppView.__init__(self, True, "migration", True) self.plan = migration.MigrationPlan() self.toolbars_mgr = migration_toolbars.ToolBarManager() self.active_tab = None self.old_active_tab = None self.set_spacing(6) self.ui_profile = migration_ui_style.UIProfile() self.left_side_cont = self.create_tasks_side() self.add(self.left_side_cont, False, False) self.tasks_side.add_section("Overview", "OVERVIEW", 0) self.tasks_side.add_section("SourceTarget", "SOURCE & TARGET", 0) self.tasks_side.add_section("ObjectMigration", "OBJECT MIGRATION", 0) self.tasks_side.add_section("DataMigration", "DATA MIGRATION", 0) self.tasks_side.add_section("Report", "REPORT", 0) self.tasks_side.add_on_section_command_callback(self.section_clicked) self.left_side_cont.set_size(220, -1) self.background = mforms.newPanel(mforms.StyledHeaderPanel) self.background.set_title("TITLE") self._page_trail = [] self.tabs = [] self._name2page = {} if platform.system() == 'Windows': self.content_box = mforms.newBox(False) self.content_box.set_back_image("migration_background.png", mforms.TopRight) self.background.add(self.content_box) self.background.set_back_color("#ffffff") else: self.tabview = mforms.newTabView(True) self.background.add(self.tabview) self.background.set_back_image("migration_background.png", mforms.TopRight) self.add(self.background, True, True) self._advancing = True self.content = {} self.add_content() self._selecting_entry = False # Load current user numeric locale: locale.setlocale(locale.LC_NUMERIC, '') self.tasks_side.select_entry(self._overview_page.identifier()) self.section_clicked(self._overview_page.identifier())
def __init__(self): mforms.AppView.__init__(self, False, 'db_copy', True) self.background = None self.content = mforms.newBox(False) if platform.system() == 'Windows': self.set_back_color("#FFFFFF") content_panel = mforms.newPanel(mforms.FilledPanel) #self.content.set_back_image("migration_background.png", mforms.TopRight) content_panel.set_back_color("#FFFFFF") else: content_panel = mforms.newPanel(mforms.StyledHeaderPanel) content_panel.set_back_image("migration_background.png", mforms.TopRight) content_panel.set_padding(8) self.header = mforms.newLabel("") self.header.set_style(mforms.WizardHeadingStyle) self.content.add(self.header, False) # On Windows doesn't use TabView as it is not transparent if platform.system() != 'Windows': self.tabview = mforms.newTabView(mforms.TabViewTabless) self.content.add(self.tabview, True, True) content_panel.add(self.content) self.add(content_panel, True, True) self._ui_created = False self._page_list = [] self._page_trail = [] self._current_page = 0 # Load current user numeric locale: locale.setlocale(locale.LC_NUMERIC, '') self.plan = migration.MigrationPlan() self.create_ui()