Comparison8 min read

Changing Web Host in Morocco: The No-Downtime Method

Changing web host is frightening for a precise reason: you picture the site offline, the e-mail lost, and nobody to ask where Tuesday's messages went. Yet copying the files is almost never what breaks. What breaks is the order — a DNS TTL that was not lowered in time, a mailbox deleted too early, a domain transferred before its zone existed anywhere else. This article describes the procedure: the sequence, the overlap period during which both hosting accounts stay up, and the two points only Morocco imposes — transferring a .ma through the national registry, and moving from a foreign invoice to a Moroccan one.

What breaks is not the file copy

Changing host involves two hosting accounts that can perfectly well run at the same time. Nothing forces you to switch one off to switch the other on: the source keeps serving the site while the destination is built, filled and tested. The only switch is DNS — and it does not flip all at once.

That is where the real risk comes from, and it is not a blank page. During the window in which resolvers do not all hold the same answer, some of your visitors still reach the old server and others the new one. Both display the site. But an order placed, a form submitted, an article published or an e-mail received on the wrong side exists only on that side — and disappears the day you shut the old hosting down. The downtime people fear is visible; the one that costs money is not.

Six things move, and not at the same pace

  • Files and the database — copyable cold, but everything written after the copy stays on the old server.
  • Mailboxes — their contents live on the source server and keep growing while you migrate: a message received after the copy is not in the copy.
  • The DNS zoneA, AAAA, MX, CNAME and TXT records (including SPF, DKIM and DMARC). It does not travel with the files: it is recreated, line by line.
  • TLS certificates — they do not move. They are re-issued on the destination, and their validation requires either that the name already points there, or a DNS challenge.
  • Scheduled tasks and application credentials — a site can display perfectly while its cron jobs no longer run and its API calls fail silently.
  • The domain name itself — transferring a domain to another registrar is an operation distinct from moving the site. It is not compulsory, and it does not have to happen on the same day.

The DNS TTL is lowered before the switch, never during

Every DNS record carries a lifetime — its TTL. Resolvers cache the answer for that long and do not come back for it any sooner. As long as the current TTL has not expired, your new address does not exist for them, whatever your zone says.

Hence the only rule that matters, and the most common mistake: the TTL is lowered beforehand, and it must be lowered at least one old-TTL period before the switch. That is what it takes for every cache to have had the chance to re-read the record and learn the new, short value. Lowering the TTL at the moment you switch achieves nothing: at that instant, resolvers are still serving the answer cached under the old lifetime.

One special case is worth spotting early: if your DNS zone is hosted with the provider you are leaving, changing name servers is itself subject to the same mechanism, and it carries everything else with it. Moving the zone first, separately, avoids stacking two propagations on the same day.

Once the switch is done and everything checked, raise the TTL again: in steady state, a short TTL multiplies queries for nothing.

Changing host in the right order

01

Inventory what actually runs

Sites and subdomains, databases, mailboxes, redirects, scheduled tasks, certificates, PHP version and enabled extensions. Whatever is not on the list will not be migrated: it will stay on the old server until that server is shut down. The inventory is taken on the server, not from memory.

02

Build the destination and prepare it

Order the target plan, create the accounts, align the PHP version and the extensions. The destination must be able to serve the site before DNS tells anyone about it. At ServOrbit.com, the migration assistant starts either from a full cPanel backup link (.tar.gz), or from a direct transfer out of your old cPanel if you still have access to it.

03

Lower the TTL

On the records that are going to change — A, AAAA and MX at minimum. To be done at least one old-TTL period before the switch, otherwise the lowering itself will not have had time to propagate.

04

Copy once, and test without touching DNS

Files, database and mailboxes. The test happens before the switch, by forcing the name to resolve to the new address on your machine alone (hosts file) or through the preview URL provided. This is where hard-coded absolute paths, permissions and missing extensions show up — while the old site keeps serving your visitors.

05

Re-copy the delta just before switching

Everything written since the first copy: orders, articles, media, messages. The shorter the interval between the two copies, the less data is left to catch up on the other side.

06

Switch DNS — and shut nothing down

Change the records, then leave both hosting accounts in service. That is the overlap period, and it is not a decorative precaution: for as long as it lasts, both servers really do receive traffic and mail.

07

Re-issue the certificates and check from outside

HTTPS and redirects, forms, sending and receiving e-mail, scheduled tasks. Check from a connection and a browser that have never visited the old server: your own machine is the worst witness there is.

08

Shut the old one down only after verified silence

The old hosting is shut down when its logs no longer show a single useful request and its mailboxes receive nothing — not when the new one works. Download and keep a full backup outside both servers before cancelling anything.

E-mail, the thing that breaks most often

A site is a frozen object you copy; a mailbox is a living one that keeps receiving while you copy it. That is the whole difference, and that is where most migrations lose data.

The sequence that holds: synchronise the mailboxes to the destination a first time, switch the MX records, let the old server keep receiving whatever still reaches it, then run a second synchronisation before shutting down. A source mail account is never deleted while it is still receiving something — and it keeps receiving long after the site itself has switched over.

Two details look like failures without being any. First, the mail clients on your machines keep the old hosting's incoming and outgoing servers in their configuration: until they are reconfigured, they collect from the old mailbox, not the new one. Second, mail authentication — SPF, DKIM, DMARC — lives in the DNS zone, not in the mailbox: changing sending server without carrying those records over sends perfectly legitimate mail to the junk folder. They are recreated with the new server's values, and verified before the old one is shut down.

Transferring a `.ma` is not an ordinary domain transfer

Two operations are often confused: moving the hosting (files, database, e-mail) and transferring the domain name to another registrar. They are independent. You can change host while leaving the domain where it is and transfer it only afterwards — that is in fact the safer order, since it avoids moving two things on the same day.

For a .ma, the transfer follows the rules of the national registry, run by the ANRT, Morocco's national telecommunications regulator. Only the providers it accredits may operate directly on that registry; the others go through an intermediary. MEGALOGI, the publisher of the platform, is among those accredited providers.

Three technical conditions must be met before filing the request: the domain must have been active for at least 60 days, its transfer lock must have been lifted with the current provider, and the authorisation code (EPP) must have been given to you. To which is added a document that generic extensions do not systematically require: the registry asks for a copy of the registrant's identity document — national ID card, passport or residence permit for an individual, a company document (ICE or RC) for a business.

Two checks are worth making beforehand, not afterwards. Who the declared registrant is: if it is your current provider and not you, the transfer depends on their agreement, and that is no longer a technical question. And where the DNS zone is actually served: changing registrar does not copy over the contents of a zone hosted with the provider you are leaving.

Transferring a generic extension or a `.ma`

What is at stakeGeneric extension (.com, .net…)National .ma extension
Who runs the registryAn international registry, open to any registrar accredited with itMorocco's national registry, administered by the ANRT
Who may carry out the transferAny registrar accredited for the extensionA provider accredited by the ANRT — the others go through an intermediary
Technical conditionsDomain unlocked and authorisation code (EPP) providedDomain unlocked, authorisation code (EPP), and domain active for at least 60 days
Registrant's identity documentNot systematically required by the registryRequired: national ID card, passport or residence permit; ICE or RC for a company
Catalogue priceSpecific to each extension — the full price list is on the domains pageRegistration à partir de 119 DH/an, incoming transfer 119 DH

Billing continuity, the other half of the change

Changing host does not only move files: it also changes the accounting document you receive at every renewal. An invoice issued outside Morocco, in a foreign currency, with no Moroccan VAT and no Moroccan legal identifiers, is not the same document as a Moroccan invoice — and the difference shows up in the books, not on screen.

Three lines change concretely. The currency your account is debited in: billed in dirhams, there is neither an exchange rate applied by your bank nor the fees that come with it. VAT, which appears on the invoice at 20% — the site's amounts being shown tax exclusive (VAT excluded). And the issuer: a Moroccan invoice carries the IF, ICE and RC of the company issuing it, which is what your accounting expects. Settlement is by Bank card — CMI, PayPal and Bank transfer.

One organisational point avoids an unpleasant surprise: the overlap period has a cost. For as long as both hosting accounts run, both are billed. That is not a risk, it is a line to plan for — and it is the real price of the method. Better to line the cancellation of the old contract up with a renewal date than with the middle of a cycle.

One last point, stated plainly rather than guessed at: our data centres are in Europe. Changing provider moves an invoice, a contractual relationship and a control panel — not the geographical position of your servers.

What to verify before shutting the old hosting down

  • The site answers over HTTPS on the new server, from a connection that has never visited the old one — your usual browser is the least reliable witness.
  • A message sent from outside to each mailbox does arrive on the new server: that is the only proof the MX records are taken into account everywhere.
  • Outgoing mail leaves and lands somewhere other than the junk folder — SPF, DKIM and DMARC recreated with the new server's values.
  • Redirects and rewritten URLs answer with the expected code: a 301 stays a 301, not a 200 nor a 404.
  • Scheduled tasks have a recent last run — their mere presence in a list proves nothing.
  • The old server's logs show not one useful request left, and its mailboxes receive nothing: fewer than before is not enough.
  • A full backup of the old hosting has been downloaded and kept outside both servers before any cancellation.

The move that avoids downtime always comes first

Go back over the three real causes before you start: a TTL nobody lowered in time, a mailbox deleted while it was still receiving, a domain transferred before its DNS zone existed anywhere else. None of the three can be recovered after the fact, and none of them shows on the new server — which works perfectly throughout. If only one sentence were to stick: delete nothing while something is still arriving on the other side.

Move your domains and your hosting, in the right order

The assistant walks through the scope step by step: domains to transfer (EPP authorisation code) and cPanel accounts to migrate, from a full backup or by direct transfer. The migration — transfer and restore — is included: you only pay for your services. Shared plans from 199 DH/year, amounts shown tax exclusive (VAT excluded).

Need help?

Browse our help center and FAQ, or reach our team — callback, WhatsApp or email. Support in French, English and Arabic.