summaryrefslogtreecommitdiff
path: root/source4/setup/upgrade
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-25 16:36:31 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-26 11:57:07 -0600
commit7c146c42d2cf51e891b9f29d3b61a40f173a3b23 (patch)
treeb4484d79dfbaa433f5712f9b15a2ae1d00299357 /source4/setup/upgrade
parentcc30cb5e24160d107b67936d71f54645d9b3d23f (diff)
downloadsamba-7c146c42d2cf51e891b9f29d3b61a40f173a3b23.tar.gz
samba-7c146c42d2cf51e891b9f29d3b61a40f173a3b23.tar.bz2
samba-7c146c42d2cf51e891b9f29d3b61a40f173a3b23.zip
r26593: - More work on the python versions of samba3dump and the samba3sam tests.
- Initial work converting the upgrade code to Python. - Removed the old EJS upgrade code because it has been broken for a long time. (This used to be commit 150cf39fbd4fe088546870fb0d8f20c0d9eb4aca)
Diffstat (limited to 'source4/setup/upgrade')
-rwxr-xr-xsource4/setup/upgrade114
1 files changed, 0 insertions, 114 deletions
diff --git a/source4/setup/upgrade b/source4/setup/upgrade
deleted file mode 100755
index f05e22f2e0..0000000000
--- a/source4/setup/upgrade
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/sh
-exec smbscript "$0" ${1+"$@"}
-/*
- Upgrade from Samba3
- Copyright Jelmer Vernooij 2005
- Released under the GNU GPL v2 or later
-*/
-
-options = GetOptions(ARGV,
- "POPT_AUTOHELP",
- "POPT_COMMON_SAMBA",
- "POPT_COMMON_VERSION",
- "POPT_COMMON_CREDENTIALS",
- 'verify',
- 'targetdir=s',
- 'quiet',
- 'realm',
- 'blank');
-
-if (options == undefined) {
- println("Failed to parse options");
- return -1;
-}
-
-libinclude("base.js");
-libinclude("provision.js");
-libinclude("upgrade.js");
-
-/*
- print a message if quiet is not set
-*/
-function message()
-{
- if (options["quiet"] == undefined) {
- print(vsprintf(arguments));
- }
-}
-
-/*
- show some help
-*/
-function ShowHelp()
-{
- print("
-Samba4 import tool
-
-provision [options] <libdir> <smbconf>
- --targetdir=DIR Output to specified directory
- --quiet Be quiet
- --blank Do not add users or groups, just the structure
- --realm=REALM Override realm to use
-
-");
- exit(1);
-}
-
-if (options.ARGV.length != 2) {
- ShowHelp();
- exit(1);
-}
-
-var lp = loadparm_init();
-
-message("Reading Samba3 databases and smb.conf\n");
-var samba3 = samba3_read(options.ARGV[0], options.ARGV[1]);
-
-if (samba3 == undefined) {
- println("Error reading Samba3 data");
- exit(1);
-}
-
-
-
-message("Provisioning\n");
-var subobj = upgrade_provision(samba3);
-var paths;
-if (options.targetdir != undefined) {
- paths = new Object();
- paths.smbconf = sprintf("%s/smb.conf", options.targetdir);
- var ldbs = new Array("hklm","hkcr","hku","hkcu","hkpd","hkpt","samdb","rootdse","secrets","wins");
- for (var i in ldbs) {
- var n = ldbs[i];
- paths[n] = sprintf("tdb://%s/%s.ldb", options.targetdir, n);
- }
- paths.dns = options.targetdir+"/dns.zone";
-} else {
- paths = provision_default_paths(subobj);;
-}
-
-var creds = options.get_credentials();
-var system_session = system_session();
-var paths = provision_default_paths(subobj);
-
-if (options.realm != undefined) {
- subobj.REALM = options.realm;
-}
-
-provision(subobj, message, options.blank, paths, system_session, creds, undefined);
-
-var ret = upgrade(subobj,samba3,message,paths, system_session, creds);
-if (ret > 0) {
- message("Failed to import %d entries\n", ret);
-} else {
- provision_dns(subobj, message, paths, system_session, creds);
-
- message("All OK\n");
-}
-
-if (options.verify != undefined) {
- message("Verifying...\n");
- ret = upgrade_verify(subobj, samba3,paths,message);
-}
-
-return ret;