summaryrefslogtreecommitdiff
path: root/source4/setup/upgrade
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-29 12:31:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:55 -0500
commit0549763600b26fadac443555e1cbec5680f91340 (patch)
tree9cf7587abd038fd83e050cc1aa4ce317cd4a6b6e /source4/setup/upgrade
parent054f206599e9d74de6429dc8f17d9c58342bcc98 (diff)
downloadsamba-0549763600b26fadac443555e1cbec5680f91340.tar.gz
samba-0549763600b26fadac443555e1cbec5680f91340.tar.bz2
samba-0549763600b26fadac443555e1cbec5680f91340.zip
r9735: More work on generating a valid Samba4 configuration using the
Samba3 data (both console and SWAT) (This used to be commit d569465dc4def55c27878028f2fc762960f453d8)
Diffstat (limited to 'source4/setup/upgrade')
-rw-r--r--source4/setup/upgrade85
1 files changed, 85 insertions, 0 deletions
diff --git a/source4/setup/upgrade b/source4/setup/upgrade
new file mode 100644
index 0000000000..447e5ee4f9
--- /dev/null
+++ b/source4/setup/upgrade
@@ -0,0 +1,85 @@
+#!/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",
+ 'quiet', '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>
+ --quiet Be quiet
+ --blank do not add users or groups, just the structure
+
+You must provide at least a realm and domain
+
+");
+ exit(1);
+}
+
+if (options.ARGV.length != 2) {
+ ShowHelp();
+ exit(1);
+}
+
+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("Writing smb.conf\n");
+// FIXME
+
+message("Provisioning\n");
+var subobj = upgrade_provision(samba3);
+provision(subobj, message, blank);
+
+message("Importing account policies\n");
+// FIXME
+
+message("Importing users\n");
+// FIXME
+
+message("Importing groups\n");
+// FIXME
+
+message("Importing WINS data\n");
+// FIXME
+
+message("All OK\n");
+return 0;