Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

For a straightforward migration, create an empty PostgreSQL database, verify access to both servers, then run pgloader mysql://myuser@myhost/dbname pgsql://pguser@pghost/dbname. pgloader converts tables, columns, keys, indexes and much of the MySQL schema while loading the data. A production migration should use a version-controlled .load file, rehearse against a disposable target, review rejected rows and warnings, and recreate views, triggers and stored routines separately because those objects are not migrated directly.

What pgloader migrates—and what it does not

pgloader is a command-line loader designed to read a MySQL database, translate its schema and data types, and write the result to PostgreSQL. The MySQL tutorial describes it as the tool of choice for moving data from MySQL to PostgreSQL. Its automatic work is substantial, but it is not a complete source-code converter for every MySQL object.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Area Typical pgloader behavior What you must verify
Tables and columns Creates PostgreSQL table definitions and loads rows. Names, data types, nullability, defaults and encoding.
Keys and constraints Handles primary keys, foreign keys and other documented constraints. Constraint validity after all rows are loaded.
Indexes Can create indexes and uniquify index names when necessary. Index coverage, uniqueness and query plans.
Auto-increment columns Converts MySQL AUTO_INCREMENT columns to PostgreSQL serial-style columns and can reset sequences. That each sequence is ahead of the current maximum key.
Comments Comments are included in the documented schema conversion. Important descriptions survived with the expected encoding.
ON UPDATE CURRENT_TIMESTAMP Translates this column behavior to a PostgreSQL before-update trigger. Whether the generated behavior matches application expectations.
Views, triggers, procedures and functions Not supported for direct migration in the references. Export, rewrite and test PostgreSQL equivalents separately.
Geometric types The documented coverage includes POINT. Any other spatial type and its application semantics.

The distinction between an automatic translation and an existing object is important: pgloader can create a trigger to reproduce the special MySQL timestamp-update behavior, while ordinary MySQL triggers, views, stored procedures and functions still require separate work.

Prepare the PostgreSQL target safely

Create an empty database and login

Use an administrative PostgreSQL connection to create a dedicated login and an empty target database. Substitute a strong password stored in your secret manager rather than committing it to a shell history or load file.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
CREATE ROLE pguser LOGIN PASSWORD 'use-a-secret-manager-value';
CREATE DATABASE dbname OWNER pguser;

The login must be able to connect to the database, create or use the destination schema, create tables, sequences, indexes and constraints, and insert data. If your organization separates ownership from deployment, grant those privileges explicitly and have the migration owner documented. Do not point a first rehearsal at a shared production database.

Make the source account read-capable

The MySQL account needs read access to every table you intend to copy and access to the metadata pgloader uses to discover definitions. If views or other objects are part of your inventory, grant the account enough metadata visibility to enumerate them even though you will recreate those objects separately. Test the account against every source schema instead of assuming that access to one table proves the migration is ready.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Test both connection endpoints

Use the same network path, firewall rules and DNS names that the migration host will use. pgloader accepts connection URLs such as:

mysql://myuser:password@myhost:3306/dbname
pgsql://pguser:password@pghost:5432/dbname

Passwords containing characters reserved by URL syntax must be URL-encoded. Keep credentials out of process listings where possible, restrict permissions on any file containing them, and rotate temporary migration credentials after the cutover. The MySQL reference also documents a JDBC connection form; use that form when the endpoint or driver setup requires it.

Run the simplest migration first

For a small rehearsal with compatible data, the shortest command is:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
pgloader mysql://myuser@myhost/dbname pgsql://pguser@pghost/dbname

With no additional directives, pgloader applies its default schema, index, foreign-key, identifier and sequence behavior. Run it against a disposable PostgreSQL database first. Capture the complete terminal output, warnings and rejected-row information; a zero exit status does not replace data validation.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Once the rehearsal is clean, use a load file. A file makes filters, casts, memory settings and destructive options reviewable, repeatable and suitable for version control.

Use a version-controlled .load file

This pattern follows the structure of the official MySQL tutorial. Change every endpoint, schema name, memory value, cast and materialized view to fit your database:

LOAD DATABASE
     FROM mysql://root@localhost/sakila
     INTO postgresql:///sakila
 WITH include drop, create tables, no truncate,
      create indexes, reset sequences, foreign keys
 SET maintenance_work_mem to '128MB',
     work_mem to '12MB',
     search_path to 'sakila'
 CAST type datetime to timestamptz
                    drop default drop not null using zero-dates-to-null,
      type date drop not null drop default using zero-dates-to-null
 MATERIALIZE VIEWS film_list, staff_list
 BEFORE LOAD DO
 $$ create schema if not exists sakila; $$;

Run it with pgloader path/to/migration.load. Store the file with the migration review record, but use a secret-injection mechanism or a protected runtime file for credentials.

Understand the important clauses

Clause Purpose Risk or decision
include drop Allows pgloader to drop target tables whose names are present in the source. Destructive. Use only on an intentionally disposable or otherwise controlled target.
create tables Creates destination tables. Omit only when a separately managed schema is deliberately being used.
no truncate Prevents automatic truncation of existing destination tables. Important when preserving a controlled target; reconcile it with any existing rows.
create indexes Builds destination indexes. Index creation can add load time; verify that every required index was created.
reset sequences Adjusts serial-style sequences after loading. Still check that each sequence exceeds the maximum key.
foreign keys Creates foreign-key relationships. Broken source relationships will surface as errors or rejected rows and need correction.
search_path Sets the destination schema context. Ensure the schema exists and that application-qualified names remain correct.
MATERIALIZE VIEWS Requests materialized output for named source views in the supported load-file scenario. This is not a general migration of the original view definition; preserve and rewrite view SQL separately.

Limit the scope or rename objects deliberately

Do not copy an entire server when the application uses only part of it. INCLUDING ONLY TABLE NAMES MATCHING restricts a load to selected tables, while EXCLUDING TABLE NAMES MATCHING removes tables from an otherwise broad selection. Keep the filter in the load file and include filtered tables in your row-count checklist.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

If source encoding metadata is wrong, DECODING TABLE NAMES MATCHING ... AS ... lets you tell pgloader how to interpret matching names. ALTER TABLE NAMES MATCHING can rename tables, move them to another schema or apply table settings in pgloader’s in-memory representation. Apply naming changes consistently to foreign keys, application configuration, grants and post-migration scripts.

Map MySQL types and clean data with CAST rules

Use a CAST section when MySQL’s permissive types or legacy values do not have a safe one-to-one PostgreSQL equivalent. User-defined rules are evaluated before built-in defaults, and the first matching rule wins. A broad rule placed before a qualified rule can therefore produce an unexpected type.

Zero dates and nullable timestamps

MySQL installations sometimes contain '0000-00-00' or zero datetime values that PostgreSQL rejects. The tutorial pattern converts datetimes to timestamptz, removes the default and NOT NULL requirement, and applies zero-dates-to-null:

CAST type datetime to timestamptz
                    drop default drop not null using zero-dates-to-null,
     type date drop not null drop default using zero-dates-to-null

This is a data-model decision, not merely a syntax fix. Confirm that application code treats NULL as the intended replacement and identify rows that lose a meaningful sentinel value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Booleans, unsigned numbers and enumerated values

Inspect how each column is actually used before writing a rule. A TINYINT(1) used as a flag may be better represented as PostgreSQL boolean, while another tiny integer may contain a numeric counter. Unsigned MySQL columns can exceed the range of a signed PostgreSQL integer, so choose a wider PostgreSQL numeric type or validate that observed values fit. Enum-like columns need an explicit decision: preserve them as text, create a PostgreSQL enum, or map them to a constrained lookup value. The same first-match rule applies to qualified columns, unsigned guards, defaults, typemods, auto_increment and on_update_current_timestamp conditions.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Binary data and text encoding

Check whether binary columns contain opaque bytes, encoded text or identifiers before choosing a PostgreSQL representation. Compare byte lengths and representative values after loading. For text, verify source connection encoding and collation assumptions; a successful insert does not prove that every character survived unchanged.

Handle auto-increment, keys and timestamp behavior

pgloader converts MySQL AUTO_INCREMENT columns to PostgreSQL serial-style columns. With reset sequences, it resets the generated sequences after data load, but validation is still required: query the maximum key and the sequence’s next value for every generated-key table before allowing writes.

Primary keys, foreign keys, unique constraints and indexes can be created by pgloader. Check them after the load rather than relying solely on creation messages. A source database that tolerated duplicate or orphaned data may fail when PostgreSQL enforces the corresponding constraint.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a column using MySQL’s ON UPDATE CURRENT_TIMESTAMP, pgloader can create a PostgreSQL before-update trigger to reproduce the behavior. Compare timezone handling, precision and update semantics with the application; a trigger that is technically present can still differ from what the application expects.

Objects requiring separate export or rewrite

Plan a parallel workstream for views, ordinary triggers, stored procedures and functions. The PostgreSQL reference lists these as unsupported for direct migration, and the MySQL reference documents only limited geometric coverage. Extract their definitions from MySQL, translate syntax and data-type assumptions to PostgreSQL, then apply them after base tables and data are validated.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
  • Rewrite MySQL-specific functions, delimiter blocks and procedural syntax in PostgreSQL’s supported language.
  • Replace MySQL view definitions that depend on implicit grouping, quoting or collation behavior.
  • Recreate triggers only after confirming that bulk-loaded data has reached a consistent state and that trigger side effects are desired.
  • Test routines and views with production-shaped parameters and permissions, not only by checking that they compile.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A production migration procedure

  1. Inventory the source. Record every table, row count, primary and foreign key, index, generated or auto-increment column, view, trigger, routine, function, spatial column and unusual date or encoding value.
  2. Prepare credentials and network access. Create least-privilege accounts, test DNS and firewall paths, and decide how passwords will be injected without exposing them in source control.
  3. Create a disposable PostgreSQL target. Create the database, destination schema and migration role. Keep the target isolated from application traffic.
  4. Write the load file. Add table filters, renames, casts, memory settings and only the options you understand. Treat include drop as destructive.
  5. Run a rehearsal. Execute pgloader, preserve its logs, and inspect warnings and rejected rows. Do not proceed merely because the process completed.
  6. Correct data and casts. Resolve zero dates, out-of-range unsigned values, invalid encodings, duplicate keys and failed foreign keys. Narrow an overly broad cast rule when it changes unrelated columns.
  7. Validate the rehearsal. Compare counts, constraints, indexes, sequences, representative aggregates and application queries. Recreate and test unsupported objects.
  8. Schedule the final load. Choose a cutover window and application freeze or other consistency method appropriate to your system. The exact downtime depends on data volume, schema, network and target configuration; canonical documentation provides no universal runtime or success percentage.
  9. Run against the final target. Use the reviewed file and the same credential and network controls. Save logs, rejected-row reports and the final schema snapshot.
  10. Cut over and monitor. Point the application at PostgreSQL only after validation passes, then watch errors, query behavior, constraint violations and sequence-generated inserts.

Post-migration validation checklist

Check How to validate Failure response
Row completeness Compare source and target counts for every table, including included and excluded filters. Inspect rejected rows, filters and transaction errors; reload only after identifying the cause.
Keys and nullability Compare primary keys, foreign keys, unique constraints and nullable columns. Resolve duplicate, orphaned or invalid source data before enforcing constraints.
Indexes List target indexes and compare names, columns and uniqueness to the source inventory. Create or adjust missing indexes and update application query plans.
Sequences Compare every generated sequence with the current maximum key. Reset the sequence before enabling inserts.
Types and values Sample integers, unsigned values, enums, dates, timestamps, zero-date replacements, binary fields and text containing non-ASCII characters. Refine qualified casts or clean source data, then repeat the rehearsal.
Behavior Run representative aggregates and application queries against both systems. Investigate collation, timezone, grouping, null and precision differences.
Unsupported objects Compile and execute rewritten views, triggers, procedures and functions. Correct PostgreSQL syntax and permissions; do not assume source definitions are portable.
Observability Review pgloader warnings, rejected rows and PostgreSQL logs. Keep the logs with the load file and schema-diff results as migration artifacts.

Troubleshoot common failures

Authentication or connection errors

Test each URL independently from the migration host. Check host, port, database name, firewall rules, TLS requirements, URL-encoded passwords and whether the account is allowed to connect from that address. A successful connection to MySQL does not validate PostgreSQL privileges, and vice versa.

Rows are rejected for dates or ranges

Find the exact column and value in the rejection output. Add a qualified cast or clean the source row rather than applying a server-wide rule that changes unrelated columns. For zero dates, use the documented conversion to NULL only after confirming that NULL is valid for the application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Target tables already contain data

Review whether the load file uses include drop, truncate or no truncate. Stop if the target is not disposable and the operation could remove or mix data. Restore from a known backup or recreate an isolated target before repeating the test.

Names collide or change case

The reference documents identifier downcasing and uniquifying index names. Compare the generated names with application SQL and migration scripts; use table-name alteration rules where necessary and update every dependent reference.

Views or routines are missing

This is expected for unsupported object classes. Export their definitions, rewrite MySQL-specific syntax, apply them after base-table validation and test with the target role’s permissions.

The migration is slow

There is no authoritative universal runtime figure. Duration depends on database size, indexes, network, source workload and PostgreSQL configuration. The project description notes parallel data loading, while the load-file pattern exposes memory settings such as maintenance_work_mem and work_mem. Change one setting at a time, measure on a rehearsal, and avoid treating a laboratory result as a guarantee for production.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When pgloader is the right approach

Choose direct pgloader loading when you need repeatable filtering, explicit type casts and a scriptable path from MySQL to PostgreSQL. Compare it with dump/restore or a managed migration service using the same questions:

Decision axis Questions to ask
Schema and type conversion Which MySQL types, defaults, unsigned ranges and encodings are translated automatically, and which need hand-written casts?
Programmable objects How will views, triggers, stored procedures and functions be exported, rewritten and tested?
Repeatability and filtering Can the method be stored in version control and rerun for only selected tables?
Cutover and downtime What consistency or application-freeze plan will keep source and target aligned during the final load?
Security Where are credentials stored, and how are network access, TLS and rotation handled?
Observability and retry Can you inspect rejected rows, resume safely and retain logs and schema diffs?
Scale and throughput How do parallel loading, index creation, available memory and network bandwidth affect the measured rehearsal time?
Manual PostgreSQL work How much rewriting is acceptable for routines, views, triggers and application SQL?

For any method, the decisive evidence is a rehearsal that passes row-count, schema, value and application-query checks. pgloader supplies the repeatable loading and transformation mechanism; your migration plan supplies the data-quality decisions, unsupported-object rewrites and cutover controls.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.