<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tt/onlinemanual/100140a" xml:lang="en" UserLevel="Expert">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">To copy a multicompany structure - Procedure details</Title>
		<Keyword ContextSensitive="No"><Level1>Companies</Level1>
			<Level2>How to copy company data</Level2>
		</Keyword>
	</Header>
	<AimSection><Paragraph class="Default">Use this procedure to copy a multicompany structure, including the <Link href="/baanerp/tg/glossary/glossary#000200" role="glossary">central company</Link> (central DEM) company, to a new multicompany structure. The target structure has its own central DEM company.</Paragraph>
	</AimSection>
	<ProcedureSection><SectionTitle>Procedure details</SectionTitle>
		<Steps><Step><StepTitle>Create target companies</StepTitle>
				<Paragraph class="Default">Create the target companies through the <GUIRef href="/baanerp/tt/aad/ttaad1100m000" role="session">Companies (ttaad1100m000)</GUIRef> session.</Paragraph>
				<Paragraph class="Default">On the <GUIRef href="" role="manual">Specific</GUIRef> menu, click <GUIRef href="" role="manual">Convert to Runtime</GUIRef> to make the changes active at runtime. Restart your bshell to load the new settings.</Paragraph>
			</Step>
			<Step><StepTitle>Define logical tables for target companies.</StepTitle>
				<Paragraph class="Default">Take this step only if logical tables are defined for one or more source companies. To define logical tables for a target company you must run the <GUIRef href="/baanerp/tt/aad/ttaad4120m000" role="session">Logical Tables (ttaad4120m000)</GUIRef> session.</Paragraph>
				<List><ListIntro>Points of attention:</ListIntro>
					<ListItem>Specify the target company number in the <GUIRef href="/baanerp/tt/aad/ttaad4120m000#ttaad420.lcmp" role="manual">Logical Company</GUIRef> field.</ListItem>
					<ListItem>Specify the logical tables for the target company. The set of logical tables must be identical to the set that is defined for the corresponding source company; only the Physical Company may differ.</ListItem>
					<ListItem>For each logical table, specify the Physical Company (one of the company numbers in the target multicompany structure) where the data of the table is stored. A special rule applies to the tccom000 and tcemm170 tables. See the note below.</ListItem>
				</List>
				<Paragraph class="Default">After you have defined the logical tables for the target companies, you must convert the changes to the runtime data dictionary and restart your bshell to load the new settings.</Paragraph>
				<Paragraph class="Default"><GUIRef href="" role="manual">Note on tccom000 and tcemm170</GUIRef>
				</Paragraph>
				<Paragraph class="Default">The tccom000 (Implemented Software Components) and tcemm170 (Companies) tables, and their reference tables such as tcmcs010 (Countries) and tccom130 (Addresses), contain data that must be shared by all companies, including the central DEM company, in the new multicompany structure. These tables must be stored physically in only one company in the new structure. The corresponding logical tables in the remaining companies in the new structure must therefore all be linked to the same physical company.</Paragraph>
				<Paragraph class="Default">For example: the new multicompany structure consists of companies 600, 601, 602 and 603. tccom000 and tcemm170 and their reference tables are physically stored in company 600. The corresponding logical tables in companies 601, 602 and 603 must therefore all be linked to physical company 600.</Paragraph>
				<Paragraph class="Default">To set up a proper sharing, including all relevant reference tables, you can use the Table Sharing Modeler. For more information, refer to <Link href="/baanerp/tl/onlinemanual/000030" role="manual">Table sharing</Link> in the ERP LN Web Help.</Paragraph>
			</Step>
			<Step><StepTitle>Export data from source companies</StepTitle>
				<Paragraph class="Default">Run the <GUIRef href="/baanerp/tt/aad/ttaad4226m000" role="session">Create Sequential Dump of Table (ttaad4226m000)</GUIRef> session to export the data of the source companies to sequential files.</Paragraph>
				<Paragraph class="Default">For each source company, the sequential files must be stored in a separate directory, e.g. directory /tmp/500 for company 500, directory /tmp/501 for company 501. Therefore you must export data from only one source company at a time and store the sequential files in the corresponding directory.</Paragraph>
				<Paragraph class="Default">You must export the data of all packages, except the Enterprise Modeling (tg) package. Therefore you must run the session twice for each source company: the first time to export data for packages in the range aa-tf; the second time to export data for the packages th-zz.</Paragraph>
				<List><ListIntro>To export data for a source company:</ListIntro>
					<ListItem>Run the <GUIRef href="/baanerp/tt/aad/ttaad4226m000" role="session">Create Sequential Dump of Table (ttaad4226m000)</GUIRef> session. <List><ListIntro>Points of attention:</ListIntro>
							<ListItem>Select the source company (only 1 company) from which data must be exported.</ListItem>
							<ListItem>Select the range of packages for which data must be exported: aa-tf</ListItem>
							<ListItem>Select the full range of tables: &lt;empty&gt; - zzz999.</ListItem>
							<ListItem>Clear the <GUIRef href="/baanerp/tt/aad/ttaad4226m000#drtb.yeno" role="manual">Drop Table after Dump</GUIRef> check box.</ListItem>
							<ListItem>Specify a field separator. This can be a pipe (|), or a caret followed by a single uppercase alphabetical character: ^A, ^B, and so on.</ListItem>
							<ListItem>Enter the directory where the sequential files must be stored. It is recommended to enter the company number as (part of) the directory name. For example: use directory /tmp/500 to store the sequential files of company 500. Note: if the specified directory does not exist, you must create it first.</ListItem>
							<ListItem>Specify the name of the error file to which all error messages and statistics information must be written.</ListItem>
						</List>
					</ListItem>
					<ListItem>Run the <GUIRef href="/baanerp/tt/aad/ttaad4226m000" role="session">Create Sequential Dump of Table (ttaad4226m000)</GUIRef> session again. Use exactly the same settings as were used during the first export, except: <List><ListItem>Range of packages: th-zz</ListItem>
							<ListItem>Enter a different name for the error file. If you use the same name, the first error file is overwritten by the second one.</ListItem>
						</List>
					</ListItem>
				</List>
				<Paragraph class="Default">Repeat these 2 steps for each source company that must be copied.</Paragraph>
			</Step>
			<Step><StepTitle>Correct company numbers</StepTitle>
				<Paragraph class="Default">The exported company data contains various references to the source company numbers. For example: the records that are exported from the Implemented Software Components (tccom000) table contain a reference to the company number of the source company.</Paragraph>
				<Paragraph class="Default">Run the <GUIRef href="/baanerp/tc/com/tccom0214m000" role="session">Copy Company Data (tccom0214m000)</GUIRef> session to correct these references in the sequential files, so that they refer to the target companies into which the data will be imported.</Paragraph>
				<List><ListIntro>Points of attention:</ListIntro>
					<ListItem>You must run this session from each source company. For example: you copy data from source companies 500 and 501 to target companies 600 and 601 respectively. After exporting data from the source companies you must: <List><ListItem>switch to company 500 and run this session to correct the references in the files that were exported from company 500: all references to company 500 and 501 must be replaced by references to company 600 and 601 respectively.</ListItem>
							<ListItem>switch to company 501 and run this session to correct the references in the files that were exported from company 501: all references to company 500 and 501 must be replaced by references to company 600 and 601 respectively.</ListItem>
						</List>
					</ListItem>
					<ListItem>Specify the field separator that is used in the sequential files: this is the same separator as the one that was specified during the export in the <GUIRef href="/baanerp/tt/aad/ttaad4226m000" role="session">Create Sequential Dump of Table (ttaad4226m000)</GUIRef> session.</ListItem>
					<ListItem>Enter the source company numbers, and the corresponding target company numbers by which they must be replaced, in the <GUIRef href="/baanerp/tc/com/tccom0214m000#comp.copy" role="field">Companies to Copy</GUIRef> field. Refer to the online help of this field for details.</ListItem>
					<ListItem>Leave the <GUIRef href="/baanerp/tc/com/tccom0214m000#eu.copy" role="field">Enterprise Units to Copy</GUIRef> field blank, because you copy an existing multicompany structure, including the central DEM company. In this case, the target companies use the new, target central DEM company. The enterprise units used in the target companies will have the same codes as the enterprise units used in the source companies. You do not need to change the enterprise unit codes because they are unique in the new target central DEM company.</ListItem>
				</List>
			</Step>
			<Step><StepTitle>Import data into target companies</StepTitle>
				<Paragraph class="Default">Run the <GUIRef href="/baanerp/tt/aad/ttaad4227m000" role="session">Create Table from Sequential Dump (ttaad4227m000)</GUIRef> session to import the contents of the sequential files into the target companies.</Paragraph>
				<Paragraph class="Default">You can only load data into a single company at a time; therefore you must repeat this session for each target company.</Paragraph>
				<List><ListIntro>Points of attention:</ListIntro>
					<ListItem>Select the <GUIRef href="/baanerp/tt/aad/ttaad4227m000#dfco.yeno" role="manual">Create Tables for Different Company</GUIRef> check box and specify the target company number.</ListItem>
					<ListItem>The target company is a new company without any tables. Therefore you must clear the <GUIRef href="/baanerp/tt/aad/ttaad4227m000#apnd.yeno" role="manual">Append if Table Exists</GUIRef> and <GUIRef href="/baanerp/tt/aad/ttaad4227m000#dltb.yeno" role="manual">Delete Existing Tables</GUIRef> check boxes.</ListItem>
					<ListItem>Select the <GUIRef href="/baanerp/tt/aad/ttaad4227m000#rbix.yeno" role="manual">Create Rows before Index</GUIRef> and <GUIRef href="/baanerp/tt/aad/ttaad4227m000#igri.yeno" role="manual">Ignore Referential Integrity Constraints</GUIRef> check boxes.</ListItem>
					<ListItem>Specify the field separator that is used in the sequential files: this is the same separator as the one that was specified during the export in the <GUIRef href="/baanerp/tt/aad/ttaad4226m000" role="session">Create Sequential Dump of Table (ttaad4226m000)</GUIRef> session.</ListItem>
					<ListItem>Specify the directory where the sequential files are stored. This is the same directory as the one that was specified during the export in the <GUIRef href="/baanerp/tt/aad/ttaad4226m000" role="session">Create Sequential Dump of Table (ttaad4226m000)</GUIRef> session.</ListItem>
					<ListItem>Enter * in the <GUIRef href="/baanerp/tt/aad/ttaad4227m000#tpat" role="manual">Pattern to Match Table Names</GUIRef> field, to load all sequential files.</ListItem>
					<ListItem>Specify the name of the error file to which all error messages and statistics information must be written.</ListItem>
				</List>
				<Paragraph class="Default">After each import the <GUIRef href="/baanerp/tt/aad/ttaad4225m000" role="session">Reorganize Tables (ttaad4225m000)</GUIRef> session is started automatically. Do not reorganize the tables at this stage. Click <GUIRef href="" role="manual">Close</GUIRef> to quit this session. The tables will be reorganized in the last step of this procedure. Check the error file when the import process is completed.</Paragraph>
			</Step>
			<Step><StepTitle>Create missing tables for target companies</StepTitle>
				<Paragraph class="Default">Run the <GUIRef href="/baanerp/tt/aad/ttaad4230m000" role="session">Create Tables (ttaad4230m000)</GUIRef> session to create missing tables for the target companies.</Paragraph>
			</Step>
			<Step><StepTitle>Define the central DEM company for each target company</StepTitle>
				<List><ListIntro>Repeat the following steps for each target company:</ListIntro>
					<ListItem>Switch to the new target company.</ListItem>
					<ListItem>Run the <GUIRef href="/baanerp/tg/brg/tgbrg0100s000" role="session">Central Company to store Enterprise Modeler Data (tgbrg0100s000)</GUIRef> session. In this session you must enter the company number of the central DEM company of the target multicompany structure.</ListItem>
				</List>
				<Paragraph class="Default"><GUIRef href="" role="manual">Example</GUIRef>
				</Paragraph>
				<Paragraph class="Default">A multicompany structure, consisting of companies 500 (central DEM company), 501, 502 and 503, is copied to a new multicompany structure, consisting of companies 600, 601, 602 and 603. You must run the above mentioned session from each of the target companies, including company 600 itself, to define company 600 as the central DEM company.</Paragraph>
			</Step>
			<Step><StepTitle>Export version and model data from the source central DEM company</StepTitle>
				<List><ListIntro>Take the following steps:</ListIntro>
					<ListItem>Switch to any of the companies in the source multicompany structure.</ListItem>
					<ListItem>Run the <GUIRef href="/baanerp/tg/brg/tgbrg1235m000" role="session">Export Version Dump (tgbrg1235m000)</GUIRef> session to export the version and model data. Points of attention: <List><ListItem>Select the version to export</ListItem>
							<ListItem>Specify the name and path of the dump file</ListItem>
							<ListItem>Click <GUIRef href="" role="manual">Yes on All Tabs</GUIRef>
							</ListItem>
							<ListItem>Click <GUIRef href="" role="manual">Yes</GUIRef> in any questions that are displayed during the export process</ListItem>
						</List>
					</ListItem>
				</List>
			</Step>
			<Step><StepTitle>Import version and model data into the target central DEM company</StepTitle>
				<List><ListIntro>Take the following steps:</ListIntro>
					<ListItem>Switch to any of the companies in the target multicompany structure.</ListItem>
					<ListItem>Run the <GUIRef href="/baanerp/tg/brg/tgbrg1245m000" role="session">Import Version Dump (tgbrg1245m000)</GUIRef> session to import the version and model data. Points of attention: <List><ListItem>Specify the name and path of the dump file that was created by the export process.</ListItem>
							<ListItem>Click <GUIRef href="" role="manual">Yes on All Tabs</GUIRef>
							</ListItem>
							<ListItem>Click <GUIRef href="" role="manual">Yes</GUIRef> in any questions that are displayed during the import process</ListItem>
						</List>
					</ListItem>
				</List>
			</Step>
			<Step><StepTitle>Correct the financial company number for enterprise units</StepTitle>
				<List><ListIntro>The enterprise units in the enterprise structure model of the target multicompany structure must be linked to the target financial companies.</ListIntro>
					<ListItem>Switch to the central DEM company of the target multicompany structure.</ListItem>
					<ListItem>Run the <GUIRef href="/baanerp/tg/brg/tgbrg0512m000" role="session">Enterprise Structure Models (tgbrg0512m000)</GUIRef> session.</ListItem>
					<ListItem>Specify the current version (the version that was imported in step 9). The imported Enterprise Structure Model is displayed.</ListItem>
					<ListItem>Select the model and subsequently, on the <GUIRef href="" role="manual">Specific</GUIRef> menu, click <GUIRef href="" role="manual">Enterprise Structure Model Browser</GUIRef>. The enterprise units are displayed in a graphical browser.</ListItem>
					<ListItem>Repeat the following steps for each enterprise unit: <List><ListItem>Select the enterprise unit.</ListItem>
							<ListItem>On the <GUIRef href="" role="manual">Specific</GUIRef> menu, click <GUIRef href="" role="manual">Details</GUIRef>. A dialog is started.</ListItem>
							<ListItem>Replace the original financial source company by the corresponding financial target company, e.g. replace company 501 by company 601.</ListItem>
						</List>
					</ListItem>
				</List>
			</Step>
			<Step><StepTitle>Specify the operational enterprise structure model</StepTitle>
				<Paragraph class="Default">Specify the operational enterprise structure model and version for the target multicompany structure.</Paragraph>
				<List><ListItem>Switch to the central DEM company of the target multicompany structure.</ListItem>
					<ListItem>Run the <GUIRef href="/baanerp/tg/brg/tgbrg0135s000" role="session">DEM Parameters (tgbrg0135s000)</GUIRef> session.</ListItem>
					<ListItem>Specify the operational enterprise structure model and the version (the model and the version that were imported in step 9).</ListItem>
				</List>
			</Step>
			<Step><StepTitle>Reorganize tables and repair reference counters for target companies</StepTitle>
				<Paragraph class="Default">Run the <GUIRef href="/baanerp/tt/aad/ttaad4225m000" role="session">Reorganize Tables (ttaad4225m000)</GUIRef> session to reorganize the tables and to repair the reference counters for all target companies.</Paragraph>
				<List><ListIntro>Select the following check boxes:</ListIntro>
					<ListItem><GUIRef href="/baanerp/tt/aad/ttaad4225m000#dataind.yeno" role="manual">Data and Indices</GUIRef>
					</ListItem>
					<ListItem><GUIRef href="/baanerp/tt/aad/ttaad4225m000#refint.yeno" role="manual">Reference Integrity</GUIRef>
					</ListItem>
					<ListItem><GUIRef href="/baanerp/tt/aad/ttaad4225m000#rcnt.yeno" role="manual">Repair Reference Counter</GUIRef>
					</ListItem>
				</List>
			</Step>
		</Steps>
	</ProcedureSection>
	<GeneralSection><Note><SectionTitle>
                                 Note
                              </SectionTitle>
			<Paragraph class="Default">For more information on the above-mentioned procedure, refer to <Link href="/baanerp/tt/onlinemanual/100140b" role="manual">To copy a multicompany structure - Example</Link>.</Paragraph>
		</Note>
	</GeneralSection>
	<RelatedTopics><SectionTitle>
                              Related topics
                           </SectionTitle>
		<RelTopic><Link href="/baanerp/tt/onlinemanual/100140" role="manual">To copy a multicompany structure</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tt/onlinemanual/100140b" role="manual">To copy a multicompany structure - Example</Link>
		</RelTopic>
		<RelTopic>To set up a company – U8422A US</RelTopic>
	</RelatedTopics>
</ManualTopic>
