summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-29 18:52:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:56 -0500
commit11f3f0fa6cfb0486bdc526465dc4c0e19467a30f (patch)
tree5afbcf0b284c5af9d158166c2b6b66c3e2700933 /source4/setup
parent615e1c55bfd0b5e5cb2ac77b19a0c395ef566bd2 (diff)
downloadsamba-11f3f0fa6cfb0486bdc526465dc4c0e19467a30f.tar.gz
samba-11f3f0fa6cfb0486bdc526465dc4c0e19467a30f.tar.bz2
samba-11f3f0fa6cfb0486bdc526465dc4c0e19467a30f.zip
r9754: Upgrading with the command line utility now works, at least partially (-:
Upgrading using SWAT should work as well now. (This used to be commit 8baa2ac377315ae8b365f58c2bda0bf3d0c5aec3)
Diffstat (limited to 'source4/setup')
-rw-r--r--source4/setup/upgrade54
1 files changed, 6 insertions, 48 deletions
diff --git a/source4/setup/upgrade b/source4/setup/upgrade
index 5d0b14bdd7..fed09f2a4e 100644
--- a/source4/setup/upgrade
+++ b/source4/setup/upgrade
@@ -11,7 +11,6 @@ options = GetOptions(ARGV,
"POPT_COMMON_SAMBA",
"POPT_COMMON_VERSION",
'ldif',
- 'dn=s',
'quiet', 'blank');
if (options == undefined) {
@@ -35,8 +34,8 @@ function message()
function ldifprint(data)
{
- if (options["ldif"] != undefined) {
- print data;
+ if (options.ldif != undefined) {
+ print(data);
}
}
@@ -64,9 +63,7 @@ if (options.ARGV.length != 2) {
exit(1);
}
-if (options.dn == undefined) {
- options.dn = "dc=example,dc=org";
-}
+var lp = loadparm_init();
message("Reading Samba3 databases and smb.conf\n");
var samba3 = samba3_read(options.ARGV[0], options.ARGV[1]);
@@ -82,49 +79,10 @@ var smbconf = upgrade_smbconf(samba3);
message("Provisioning\n");
var subobj = upgrade_provision(samba3);
-provision(subobj, message, blank);
-
-var samdb = ldb_init();
-samdb.connect(lp.get("setup directory") + "/samdb.ldb");
-
-message("Importing account policies\n");
-var ldif = upgrade_policy(samba3);
-ldifprint(ldif);
-samdb.modify(ldif);
-
-// FIXME: Enable samba3sam module if original passdb backend was ldap
-
-message("Importing users\n");
-for (var i in samba3.samaccounts) {
- message("Importing user '" + samba3.samaccounts[i].username + "'");
- var ldif = upgrade_sam_account(samba3.samaccounts[i]);
- ldifprint(ldif);
- samdb.add(ldif);
-}
-
-message("Importing groups\n");
-for (var i in samba3.groupmappings) {
- message("Importing group '" + samba3.groupmappings[i].username + "'");
- var ldif = upgrade_sam_group(samba3.groupmappings[i]);
- ldifprint(ldif);
- samdb.add(ldif);
-}
-
-message("Importing WINS data\n");
-var ldif = upgrade_wins(samba3)
-ldifprint(ldif);
-setup_ldb(ldif, "wins", Object());
-
-message("Importing registry data\n");
-var hives = ["hkcr","hkcu","hklm","hkpd"];
-for (var i in hives) {
- var regdb = ldb_init();
- regdb.connect(lp.get("setup directory") + "/" + hives[i] + ".ldb");
- var ldif = upgrade_registry(samba3, hives[i]);
- ldifprint(ldif);
- ldb.add(ldif);
-}
+provision(subobj, message, options.blank);
+ok = upgrade(subobj,samba3,message);
+assert(ok);
message("All OK\n");
return 0;