User Migration Without Password Loss – Lazy Migration & ETL

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
User Migration Without Password Loss – Lazy Migration & ETL
Complex
~2-3 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

User Migration – A Technical Challenge We Solve Without Access Loss

Our user migration service specializes in password migration using lazy migration and ETL techniques, ensuring no password loss. When a business decides to move to a new CMS or framework, the most delicate issue is users. Their passwords are encrypted with the old algorithm—sha512 with salt (Drupal 7), phpass (WordPress), or md5($password.$salt) from a custom CRM. The new system doesn't understand these hashes, and simply copying the database won't work—nobody will be able to log in. Worse, engineers often make the mistake of copying the user table as-is, only to find that all passwords are invalid. The result is a mass session reset and loss of loyalty. We've carried out over 50 migrations, including projects with 200,000 users, and know how to transfer users so they don't even notice the move. Below is a proven strategy and the tools (Python, Golang, Laravel, Django) we use on every project. Our services start at $2,000 for databases up to 100,000 users, with typical savings of 30-50% compared to full system rebuilds. For a typical project with 100k users, the cost is $2,000 and average savings are $3,000-$5,000. We guarantee that no user will lose access.

Problems We Solve

  • Hashing algorithm incompatibility: the old system uses sha512 or MD5, the new one only bcrypt.
  • Duplicate users by email when merging databases.
  • Loss of roles and access rights during transfer.
  • Need to preserve active sessions and avoid mass re-login.
  • SSO integration for temporary co-existence of old and new platforms.

Why Lazy Migration Is Better Than Full Rehashing

Lazy migration allows user transfer without downtime or access loss. Old hashes remain in the database, and on each login the algorithm is checked; on success, the password is rehashed with the new one. This is 3–5 times faster than a full forced reset and doesn't cause user churn. Moreover, it enables gradual migration without downtime—you can migrate the database in the background while 100% load remains on the old system. 90% of users don't even notice the migration process. Lazy migration preserves salting and key stretching properties inherent in algorithms like bcrypt and PBKDF2, and it avoids rainbow table attacks by leveraging bcrypt's adaptive cost factor.

Strategy Implementation Time User Impact Security
Lazy migration 1-2 days Minimal, transparent process High with correct implementation
Forced reset 1-3 days Requires user password change High
Full rehashing 3-7 days Medium, possible temporary unavailability Medium (errors during mass rehashing)

Forced Reset for Legacy Algorithms

If supporting outdated algorithms (MD5, SHA1) is undesirable, we send users an email with a reset token. This is safer than storing weak hashes. Scenario: a script finds all users with algorithm legacy_md5, generates a one-time token, and sends an email. Token validity is 7 days. After a successful change, the password is saved with bcrypt.

When the New System Does Not Support the Old Algorithm

In this case, we implement an intermediate verification layer. For example, for phpass (WordPress) we use a custom Python implementation. "PHPass is a portable public domain password hashing framework"—its algorithm is supported via a custom function. Similarly for PBKDF2 (Django) and sha512 (Drupal 7). This preserves compatibility without rewriting the entire system.

How to Implement Lazy Migration

Step-by-step plan:

  1. Analyze existing hashes and identify algorithms.
  2. Implement a verification function for each algorithm.
  3. Add rehashing logic on successful login.
  4. Develop ETL script for data transfer.
  5. Test on a copy of the database.
  6. Run migration and monitor errors.

The main idea is to store the original hash and algorithm label in the password_algorithm field. On login, call the verify_password function, which checks the algorithm, and on success—upgrade_password_hash. Let's look at the Python implementation.

# models/user.py
class User(BaseModel):
    password_hash: str
    password_algorithm: str  # 'bcrypt', 'phpass', 'sha512', 'legacy_md5'

    def verify_password(self, plain_password: str) -> bool:
        if self.password_algorithm == 'bcrypt':
            return bcrypt.checkpw(plain_password.encode(), self.password_hash.encode())
        elif self.password_algorithm == 'phpass':
            return phpass_check(plain_password, self.password_hash)
        elif self.password_algorithm == 'legacy_md5':
            return hashlib.md5(plain_password.encode()).hexdigest() == self.password_hash
        elif self.password_algorithm == 'pbkdf2_sha256':
            return django_pbkdf2_check(plain_password, self.password_hash)
        return False

    def upgrade_password_hash(self, plain_password: str):
        new_hash = bcrypt.hashpw(plain_password.encode(), bcrypt.gensalt(rounds=12))
        self.password_hash = new_hash.decode()
        self.password_algorithm = 'bcrypt'
        db.save(self)

PHPass Compatibility Check (WordPress)

Implementation details for WordPress WordPress uses [phpass](https://en.wikipedia.org/wiki/PHPass). For integration with Python:
import hashlib

ITOA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'

def phpass_check(password: str, stored_hash: str) -> bool:
    if stored_hash.startswith('$P$') or stored_hash.startswith('$H$'):
        return _phpass_verify(password, stored_hash)
    return hashlib.md5(password.encode()).hexdigest() == stored_hash

def _phpass_verify(password: str, hash_str: str) -> bool:
    count_log2 = ITOA64.index(hash_str[3])
    count = 1 << count_log2
    salt = hash_str[4:12]
    hash_val = hashlib.md5((salt + password).encode()).digest()
    for _ in range(count):
        hash_val = hashlib.md5(hash_val + password.encode()).digest()
    output = _encode64(hash_val, 16)
    return hash_str[12:34] == output[:22]

ETL: User Transfer with Role Mapping

For bulk transfer, we use an ETL script. Example for WordPress:

def migrate_users_from_wordpress(wp_db, new_db):
    cursor = wp_db.cursor(dictionary=True)
    cursor.execute("""
        SELECT u.ID, u.user_login, u.user_pass, u.user_email,
               u.user_registered, u.display_name,
               um.meta_value as first_name, um2.meta_value as last_name
        FROM wp_users u
        LEFT JOIN wp_usermeta um ON u.ID = um.user_id AND um.meta_key = 'first_name'
        LEFT JOIN wp_usermeta um2 ON u.ID = um2.user_id AND um2.meta_key = 'last_name'
        ORDER BY u.ID
    """)
    migrated = 0
    skipped = 0
    for wp_user in cursor.fetchall():
        existing = new_db.get_user_by_email(wp_user['user_email'])
        if existing:
            skipped += 1
            continue
        algorithm = detect_wp_hash_algorithm(wp_user['user_pass'])
        new_db.create_user({
            'username': wp_user['user_login'],
            'email': wp_user['user_email'],
            'password_hash': wp_user['user_pass'],
            'password_algorithm': algorithm,
            'display_name': wp_user['display_name'],
            'created_at': wp_user['user_registered'],
            'legacy_id': wp_user['ID'],
        })
        # Role mapping: from wp_usermeta meta_key = 'wp_capabilities'
        roles = get_user_roles(wp_db, wp_user['ID'])
        new_db.assign_roles(wp_user['user_email'], roles)
        migrated += 1
    print(f"Migrated: {migrated}, Skipped: {skipped}")

Handling Login and Rehashing

def login(email: str, password: str):
    user = db.get_user_by_email(email)
    if not user:
        return None
    if user.verify_password(password):
        if user.password_algorithm != 'bcrypt':
            user.upgrade_password_hash(password)
        return create_session(user)
    return None

What's Included in User Migration Work

  • Audit of current user database and hashing algorithms.
  • Development of ETL scripts with role mapping and additional fields.
  • Implementation of lazy migration (or forced reset) with testing on a copy.
  • Monitoring setup after deployment (24-hour observation).
  • Rollback procedure documentation and backup.

Timelines and Common Mistakes

Estimated Timelines

  • For databases up to 100,000 users: 2–3 working days for audit, development, and testing.
  • For databases from 100,000 to 500,000 users: 5–7 days including ETL and load testing.
  • Large projects with dozens of roles and custom fields may require more time.

Common Migration Mistakes

  • Missing duplicate email checks—leads to conflicts and data loss.
  • Ignoring role mapping—users are transferred but lose access rights.
  • Attempting to rehash all passwords at once—causes CPU load and errors.
  • Lack of rollback plan—no quick recovery on failure.
  • Not closing old sessions—users remain in the system with old data.

Tips:

  • Always test on a copy of the database.
  • Use transactions and scripts with rollback.
  • Set up error monitoring after deployment (first 24 hours are critical).
  • Keep a backup of the old database and a reverse migration script.

Hashing Algorithm Comparison

Algorithm Hash Length Brute Force Resistance Standard in CMS
bcrypt 60 characters High (cost adjustable) Laravel, Symfony, Rails
phpass 34 characters Medium (MD5-based) WordPress, Drupal 7
PBKDF2 98 characters High Django, Python
MD5 32 characters Low Legacy systems

Order an audit of your project—first day free. Contact us for a consultation and get an accurate estimate with a guaranteed result.

Website Redesign and Migration: CMS Change, SEO Preservation

A client came to us 6 weeks after a self-attempted redesign: 'We moved from WordPress to Tilda, traffic dropped by 70%.' I opened Google Search Console — 847 pages returned 404, the URL structure had completely changed, not a single 301 redirect was in place. Yandex hadn't reindexed the new site yet, positions collapsed. Recovery took 4 months and resulted in significant revenue loss for the quarter. Our experience — over 7 years and 80+ successful migrations, we guarantee position retention with the right approach.

Why Do Migrations Break SEO?

Search engines have indexed specific URLs. If /catalog/shoes/nike-air-max-270 turned into /products/nike-air-max-270 without a 301 redirect — all the link equity, traffic, and rankings go nowhere. Google says 301 passes ~99% of PageRank, but in practice positions recover over 2–8 weeks, not instantly.

Commonly, SEO gets broken not out of malice, but because a developer doesn't view the URL structure as a public API. Here are typical breakages:

Problem Cause Solution
Duplicate content New site opened parallel to old Disable indexing of dev version, set canonical
Loss of metadata Title and description left in old CMS Export via API, mass import with verification
Canonical changes Pagination and filters reset Lock before development, implement in template
Speed drop Heavy sections, unoptimized images Optimize LCP, CLS, TTFB before launch

How to Recover Traffic After a Failed Migration?

If traffic dropped, act immediately:

  1. Crawl the new site for 404s and compare with the pre-migration URL list.
  2. Create redirects for all lost pages with traffic >0.
  3. Check structured data and meta tags on a test sample.
  4. Daily monitor Coverage in Search Console and positions for top 50 queries.
  5. If after 2 weeks traffic does not recover — deep audit of redirects (transitivity, chains, loops).

In our practice, a large e-commerce site lost 50% of traffic when moving from Bitrix to React + Strapi. We restored 95% of redirects in three days, and within 3 weeks traffic returned to 90% of original.

What Does a Pre-Migration Audit Include?

Before starting development on the new site:

  1. Full crawl of current site via Screaming Frog or Sitebulb. Get list of all indexable URLs with traffic from Google Search Console.
  2. Export all pages with organic traffic >0 over the last 6 months — these are priority for redirects.
  3. Record all external backlinks to specific pages — Ahrefs, Semrush.
  4. Snapshot current positions for key queries — baseline for post-migration comparison.
  5. Save Core Web Vitals from Search Console for the previous 90 days.

Table for recording:

Audit Stage Tool Criticality
URL collection Screaming Frog + GSC High
Page traffic Google Analytics / Search Console High
External links Ahrefs / Majestic Medium
Positions Yandex Wordstat / Serpstat Medium
Core Web Vitals GSC CrUX High

Contact us for a detailed pre-migration audit — we will help identify all risks and create an action plan.

URL Mapping and Redirects

For projects with 200+ pages, we create a mapping table: old URL → new URL → status (301, merged with another page, deleted). Each row is verified: does the content actually migrate here?

In Laravel, redirects are handled via configuration file and middleware, not .htaccess — faster and more manageable. For WordPress → Next.js: redirects are set in next.config.js (static) and at the Nginx/CDN level for dynamic ones. Old .htaccess on shared hosting with 500+ lines of redirects is a special hell. Each redirect is checked sequentially, performance suffers. We move to Nginx map directive or Redis cache for dynamic lookup. More at Wikipedia: HTTP 301.

How to Migrate Content from Different CMSs?

WordPress → Headless CMS (Contentful, Strapi, Sanity): WordPress REST API or WP All Export to export posts, meta fields, media files. Migration script in Node.js: parse export, transform structure, upload via CMS API. Media files are reuploaded to new storage, links updated in content. Typical problem — shortcodes in WordPress content ([gallery id="123"]): need parser and transformation to new format.

1C-Bitrix → modern stack: Bitrix stores content in non-standard tables with IBLOCK_ELEMENT_PROPERTY. Direct SQL export via phpMyAdmin or Bitrix API. Transformation is the longest part due to specific Bitrix data structure.

Heavy WYSIWYG → structured content: Years of editing in FCKEditor/TinyMCE leave inline styles, non-standard tags, broken attributes. HTML sanitize + transformation to Markdown or Portable Text (Sanity) with manual check of problematic pages.

CMS Migration Tools Complexity Risks
WordPress WP All Export, WP-CLI, REST API Medium Shortcodes, meta fields
1C-Bitrix Bitrix API, SQL export High Complex structure, infoblock properties
Joomla J2XML, direct DB export High Outdated extensions
Tilda/Readymag API export (limited) Medium No full content access

How to Preserve Technical SEO Elements During Migration?

Structured data (Schema.org) — if the old site had Product, Article, BreadcrumbList markup, they must be on the new site too. Google Search Console → Enhancement reports will show loss of rich snippets.

Sitemap XML: generated automatically, submitted to GSC a day after launch. Old sitemap remains until full reindexing.

hreflang for multilingual sites: if tags are lost during migration, conflicts between language versions in search results will start within weeks.

Open Graph and Twitter Card meta tags — often forgotten when changing template, pages stop displaying correctly when shared on social networks.

Launch and First Weeks Monitoring

DNS propagation: DNS switching takes up to 48 hours, plan launch with buffer. Cloudflare as DNS provider — propagation takes minutes, not hours.

After launch, monitor daily: Search Console → Coverage (indexing errors), Analytics → organic traffic, year-over-year comparison, crawl site for 404 errors.

First 2 weeks are critical. If traffic drops more than 30% — immediate audit of redirects and comparison with pre-migration crawl.

Launch checklist (spoiler)
  • [ ] All 301 redirects work and do not form chains
  • [ ] Sitemap submitted to GSC and Yandex.Webmaster
  • [ ] Canonical tags set on all pages
  • [ ] Open Graph / Twitter Card display checked
  • [ ] robots.txt and noindex meta tags adjusted
  • [ ] Core Web Vitals in green zone (LCP <2.5s, CLS <0.1, INP <200ms)

What the Service Includes

Results you receive:

  1. Migration plan with URL mapping and redirects in Excel/Google Sheets format.
  2. Configured 301 redirects at server level (Nginx/Cloudflare/Vercel).
  3. Migrated content with integrity check: images, meta fields, links.
  4. Structured data (Schema.org) on the new site, identical to old or improved.
  5. SEO report: position trend at 1, 3, and 6 weeks after launch.
  6. Coverage monitoring in Search Console with error notifications.
  7. Guaranteed position retention: if traffic drops more than 15% within the first month — free audit and correction.

Timelines and Estimates

  • Redesign with migration for a small site (up to 100 pages): 4–8 weeks.
  • E-commerce migration with 500+ product pages: 8–16 weeks.
  • Only technical migration part (redirects, metadata) without redesign: 1–3 weeks.

Cost is calculated individually based on scope.

Get a consultation for your project — we will respond within a day. Order a pre-migration audit of your site and receive a detailed proposal with a redirect plan. Contact us to discuss details.