This is happening for most accounts, It’s stage 0, I reset the DNS zone to default and it still fails.
Why does it fail doing a replace when nothing is changing?
Even better, reloading the zone and it shows this. Apparently it’s changing the IP in Stage 0 to the new IP but it’s not replacing, it’s creating a new record altogether.
After initial stage completes, a subsequent migration job is backgrounded to start 24 hours after this. Once this is done, the DNS is updated to the new server.
$ at -l
25216 Wed Jul 10 15:04:00 2024 a root
$ at -c 25216
#!/bin/sh
**snip**
/usr/local/apnscp/bin/php-bins/apnscp_php ./transfersite.php site2
If transfersite.php is re-run with --force or within ~23 hours of initial completion, without setting --stage=0, then it’s assumed to begin on stage 1. Stage 0 is initial creation/migration DNS priming. Stage 1 is follow-up migration, which updates DNS. Stage 2 is completed.
Likewise DNS for both the primary domain and addon domain look as expected. It’s important to note [dns] => uuid must be unique between servers. This is used to determine where a domain is presently located. It can be verified with cpcmd scope:get cp.config dns uuid.
Further, finalizing migration with ./transfersite.php site2 --force updates the IP addresses correctly without adding duplicate records. Make sure you’re using the latest PowerDNS driver and not a fork.
Delete the domain on the target server. Re-run ./transfersite.php -s NEW-SERVER-NAME --stage=0 DOMAIN .
Before you do this, regenerate the UUID value on target server; this is used to determine which server is active for a given domain.
cpcmd scope:set cp.config dns uuid null
upcp -sb apnscp/bootstrap
I believe you copied config/custom/config.ini to the new server to preserve customizations, which includes the UUID. Transfer replays all API calls during both stages, so this includes deleting then recreating the domain. If the UUID value matches the target server, then DNS is removed for this domain upon deletion.
I don’t copy the config file, all customizations are done via commands and the UUID on both servers is for sure different. Even that one account, when deleted from the new server preserves the DNS because the UUID matches the old server.
change_dns.php will reset all records to the old IP. Run this on source. Additionally, there’s a no-op check with DNS updates in edge now that will prevent attempting to update an IP if old is new.
Hop on edge until the next release on the source server:
/usr/local/apnscp/bin/scripts/transfersite.php --all --stage=0 --server=NEW_SERVER isn’t respecting the stage. Any account that has been deleted on the new server is still trying to do Stage 1. Is this a conflict with --all and --stage=0? do I need to do a loop instead?
One last thing… When doing --all, when it sends a failure email, it appends the previous failure and doesn’t reset and only send the failure for the relevant domain.