When a Dify migration is more than an export and import
A Dify migration moves app definitions from Dify Cloud or another LLM tool onto infrastructure you control, and it is more than an export and import. The YAML DSL export and import carries app configuration, workflow nodes, model parameters, prompts and knowledge base connections. It does not carry third-party API keys, knowledge base content or usage logs, so you rebuild those parts on the new instance. Plan the work as two streams: moving app definitions, and re-creating the data and credentials those definitions depend on.
Teams usually move for four reasons: data residency, sandboxing of code and tool execution, access control through their own identity provider, and cost control over model and infrastructure spend. Each reason changes the target design. A residency requirement drives where the metadata database, file storage and vector store live. Sandboxing and access control drive the security configuration of the new stack. Confirm the current settings and retention rules with your compliance team before you pick a target, because those answers decide what must be re-created and what must be verified afterward.
Whether to migrate in-house or with a partner depends mainly on three factors: the number of apps, the volume of knowledge base documents that must be re-ingested, and how many flows call external tools or internal APIs that need new credentials and endpoints. A small set of prompt-only apps with few knowledge bases is often a contained internal task. Many flows with large document sets and several external tool connections usually need a written inventory, a re-ingestion plan and a test pass per app, which is where a fixed-scope partner engagement is typically useful. Ask your team to list every app, knowledge base and tool connection before deciding.
What a Dify migration project includes and delivers
A migration moves four kinds of content: app configuration, knowledge bases, credentials and test evidence. Each work component below ends in a named deliverable so the client can check progress and sign off before cutover.
App and workflow inventory
The team lists every app, workflow, agent and knowledge base in the source Dify Cloud workspace or other tool, with owner, model, tools and data sources. The app inventory becomes the scope baseline, so unlisted apps are not silently dropped. Check which apps are live, which are drafts and which depend on each other before agreeing the migration list.
App management docsDSL export and import with validation
Apps are exported as YAML DSL files and imported into the self-hosted workspace, then compared node by node against the source. The deliverable is an import log recording each file, its result and any node that needed manual correction. Confirm that prompts, model parameters and knowledge base links survived the round trip, since the export does not carry third-party API keys.
Knowledge base rebuild from source documents
DSL exports carry knowledge base connections but not document content, so every knowledge base is recreated from the original files, sources and chunking settings. The deliverable is a rebuilt knowledge base list with document counts, indexing status and retrieval settings per base. Ask who holds the original documents and whether any of them are restricted before work starts.
Model provider and credential setup
Every model provider and third-party API key must be re-entered in the new instance, because keys are not part of the export. The team configures providers, stores credentials in the self-hosted environment and checks that each app resolves to the intended model. The deliverable is a credential register that names each provider, owner and rotation point, without recording the secret values.
Porting prompts and flows from other tools
Where the source is another LLM tool rather than Dify, prompts, tool calls, branching logic and variables are mapped by hand into Dify nodes. Differences in how each tool handles context, memory and tool schemas are documented as they are found. The deliverable is a porting map that links each source element to its Dify equivalent, with the gaps that need a decision from the client.
Cutover testing and test record
Migrated apps are run against a fixed set of representative inputs and compared with the source outputs, and access is checked for each user group. The deliverable is a test record listing cases, expected and actual results, defects and retests, signed off by the client owner. Agree in writing what counts as a pass and who decides on a go-live.
What makes a Dify migration take longer or cost more
This table lists the factors that expand a Dify migration and explains why each one adds work. Read each row for the reason it matters and the step that keeps it under control. The main takeaway is that knowledge base rebuilding, credential re-entry and cutover freezes usually drive more effort than the YAML export itself.
| Driver | Why it adds effort | How to keep it down |
|---|---|---|
| Number of apps and workflow nodes | Each app's DSL must be exported, imported and tested, and every node referencing a model or tool needs checking after import. | Inventory apps by owner and usage first, retire unused apps, and migrate in groups of related workflows. |
| Size and source of knowledge base documents | Document content is not included in DSL exports, so every knowledge base must be re-ingested, chunked and re-indexed in the target. | Collect source files early, remove duplicates and outdated content, and confirm each source location is still reachable. |
| Model providers and API keys to re-enter | Third-party API keys are not exported, so each provider credential must be created again in the self-hosted workspace and tested. | List every provider and model in use, and confirm which keys will be issued fresh rather than copied. |
| Custom tools or plugins referenced by flows | Tools and plugins must be installed or rebuilt in the target, and flows that call them fail until those dependencies exist. | Build a dependency list per app and install or rebuild shared tools before importing the flows that use them. |
| Prompts written for another tool's syntax | Variable names, template markup and node conventions from other tools must be rewritten and then retested against outputs. | Keep a prompt-by-prompt mapping sheet and set acceptance tests with expected outputs for each key flow. |
| Number of environments | Development, staging and production each need their own credentials, knowledge bases and configuration, so each copy multiplies setup and verification. | Limit environments to what the team needs and promote changes through one defined path. |
| Compliance evidence needed for the move | Assessors may ask for records of what was moved, who approved it, access settings and backup tests, which add documentation work. | Agree the evidence list before cutover and capture it during each migration step rather than afterward. |
| Community or Enterprise target | Community is limited to a single workspace, so multiple workspaces, SSO or high availability needs add scope and must be confirmed before design. | Confirm required workspaces, SSO and availability needs with the vendor and your own environment before the migration plan is fixed. |
| Changes during cutover | Edits made in the source while the migration runs create drift, forcing repeated exports and re-testing. | Freeze app changes for the cutover window and record the final versions that were exported. |
Apps move as DSL files, while documents and keys must be re-established
The path starts with a Dify Cloud workspace or another LLM tool and exports each app as a YAML DSL file. That file carries app configuration, workflow nodes, model parameters, prompts and knowledge base connections, so it moves app logic into the self-hosted Dify. Source documents must be uploaded again to rebuild each knowledge base, and model provider API keys must be entered by hand in the target. Run test conversations on each app before cutover, and confirm that the rebuilt knowledge bases return the expected answers.
App logic travels in DSL files, while documents and API keys are re-established separately.
How the migration runs from inventory to cutover
The sequence moves AI apps from Dify Cloud or another LLM tool onto a self-hosted Dify in order, so each app is proven in the target environment before any user depends on it. Each phase produces a written artifact that the next phase relies on.
Inventory every app, dataset and credential
Your team lists each app, workflow, agent, knowledge base and model provider in the source system, with its owner, its users and the data it touches. For Dify Cloud sources, note which apps use third-party API keys, since those keys are not included in exports. For other LLM tools, record prompts, flow logic, tool connections and evaluation sets. The output is a migration register with one row per asset, a target decision (migrate, rebuild or retire) and a named owner. The step is done when the register has been reviewed by the app owners and the security team.
Confirm the target environment is running
The self-hosted Dify must already be deployed and reachable, using Docker Compose or the Enterprise setup. Those deployment steps are covered on the sibling implementation pages, so this step only checks readiness: the services start, administrators can sign in, the metadata database and file storage are the ones you chose, and a test model provider can be configured. Confirm the target version against the release you plan to use, since minor releases arrive about monthly. The output is a signed-off environment checklist that the migration team can rely on.
Pilot one app through export and import
Pick one low-risk app with a simple workflow and export it as a YAML DSL file from the source. Import it into the target workspace and compare the imported configuration, workflow nodes, model parameters, prompts and knowledge base links against the source. Expect the import to flag missing model credentials and missing knowledge base content, because those do not travel in the file. The output is a pilot record listing every difference found and the fix applied, which becomes the template for the remaining apps.
Rebuild knowledge bases from source documents
Document content is not exported, so each knowledge base must be recreated in the target from the original files, with the same chunking and retrieval settings recorded in the register. Reconnect the rebuilt knowledge base to the imported app and confirm the links resolve. Run a set of known questions against each rebuilt base and compare retrieved passages with the source. The output is a knowledge base acceptance sheet per dataset, showing the document count, the settings used and the test questions with results.
Re-enter credentials through a controlled process
Model provider keys and tool credentials are re-entered in the target by a named administrator, not by copying values between chat messages or spreadsheets. Each key is issued or rotated for the self-hosted deployment where the provider allows it, scoped to the minimum needed, and recorded in your secrets inventory with its owner. Confirm that the stored credentials are encrypted at rest under your key configuration. The output is a credential log that lists each provider, the owner, the date of entry and confirmation that the old key in the source is revoked after cutover.
Port prompts and flows from other tools
Apps built in other LLM tools are not imported from Dify DSL files, so each prompt, tool call, routing rule and output format is rebuilt as a Dify workflow or app. Map every source step to a Dify node, note behaviors that do not translate directly, and keep the source prompt text as the reference. Where the source used code or custom tools, decide whether a Dify node or an API-based tool covers the need. The output is a port map per app that shows source step, target node and any intentional change in behavior.
Run parallel testing against agreed cases
Both the migrated app and the source (or the expected output from the port map) receive the same set of agreed test inputs, including edge cases, adversarial prompts and inputs that should be refused. Outputs are compared by the app owner, and differences are classified as acceptable, fixed or blocking. Security-relevant checks such as tool permissions and data access are included in the same run. The output is a signed test report per app with the case count, the differences and the decision to proceed.
Cut over with a documented rollback path
Users are moved to the migrated apps on a date the owners agree, with the source app kept read-only and its credentials kept active until the rollback window closes. Before cutover, take a backup of the target and confirm it can be restored. If a blocking issue appears, traffic returns to the source and the issue is logged against the port map or register. The output is a cutover record showing the apps moved, the backup reference, the rollback trigger and the date each source app was retired.
How the migration differs by starting point
Dify Cloud is the most direct path because apps can be exported and imported as YAML DSL files. The export carries the app configuration, workflow nodes, model parameters, prompts and knowledge base connections, so the logic of each app moves with it. What does not move is the data and the secrets, which you will need to restore or recreate on the self-hosted side.
- App configuration and flows: Workflow nodes, prompts and model parameters come across in the DSL file, so you can review them directly in the imported app.
- Knowledge base content: Document content is not exported. Re-upload the source files and rebuild the indexes in your own vector store.
- Third-party API keys: Model provider keys are not exported. Re-enter them in the self-hosted workspace and confirm which account each key belongs to.
- Usage logs and conversation history: Logs are not part of the export. Decide with your compliance team whether you need to keep them in the cloud account.
- Knowledge base connections: Confirm that each imported app points to a knowledge base that exists on the new instance, since connections can break when the source data is missing.
Before cutover, run a set of test conversations against each imported app and compare answers with the Cloud version, especially for retrieval-based flows.
Apps built in other LLM tools generally do not come across as DSL files, so the work is a rebuild. Prompts can be copied as text, but flows, tool connections and retrieval settings have to be mapped onto Dify's own node types. Plan this as a design exercise with the application owner, not as an import.
- Prompts and instructions: Copy the wording and variables, then check how each variable is named and passed between steps in Dify.
- Flows and chains: Map each step from the source tool to a Dify workflow node, recording the inputs and outputs of every node so the behavior can be compared.
- Tools and integrations: Recreate each external call as a Dify tool or API-based tool, and confirm the credentials and permissions it needs on your network.
- Document retrieval: Rebuild the knowledge base from the original files, choose the chunking and retrieval settings again, and test answers against known questions.
- Model and provider settings: Configure each model provider in Dify and confirm context limits, temperature and output format match what the app expects.
Use a side-by-side test set with expected answers for each app. Differences in output are normal after a rebuild, so agree in advance which differences the application owner will accept.
Moving apps between self-hosted Dify instances, for example from an older deployment to a new host or a newer version, reuses the DSL export path, but the surrounding environment matters more. Configuration that worked on one version may need adjustment on the next, and a DSL file alone does not show whether the target can run the same nodes and plugins.
- Upgrade path: Follow the upgrade guide for each target version on the GitHub Releases page, and do not skip versions unless that guide allows it.
- Environment variables: Compare the target
.envfile with.env.exampleand add any new variables before starting the stack. KeepSECRET_KEYidentical, or users will be logged out and encrypted credentials may not decrypt. - Plugin compatibility: Confirm that the plugins used by each app are installed and supported on the target version before importing, since plugin daemon changes can affect them.
- Data and secrets: Knowledge base content, model keys and usage logs need their own migration plan, as they are not part of the DSL export.
- Backups: Take a full backup of the database, file storage and configuration before every step, so you can roll back.
Run the import in a staging instance first, and check each app's workflow, retrieval and tool calls before pointing users at the new environment.
What goes wrong in Dify migrations and how to prevent it
Most Dify migration problems come from assuming that a YAML export carries more than it does. Knowledge bases, secrets, tool dependencies and retrieval settings all need a deliberate step on the target, and the source must stop changing before you cut over.
Assuming knowledge bases were exported
The DSL export carries knowledge base connections but not the documents or their indexed content. An app imported without its knowledge base can run and answer from nothing, which looks like a model fault. Before cutover, inventory every knowledge base, collect the original source files, and plan to re-upload and re-index them on the self-hosted instance. Confirm the document count matches the source.
App management docsLosing API keys that were never recorded
Third-party model and tool API keys are not included in exports, so every credential must be re-entered on the target. Teams that never wrote down which key backed which provider discover gaps only when a workflow fails in production. Build a credential register before migration that lists each provider, the owning account, and who can rotate the key. Store the values in your secrets manager, not in a document.
Prompts tied to another tool's syntax
A prompt written for another platform may use variables, templating or conditional blocks that Dify does not interpret the same way. The text imports cleanly, then produces malformed output or leaks placeholder text to users. For each ported prompt, list its input variables and rerun a fixed set of test inputs on the target, comparing outputs with the source. Treat any mismatch as a blocker until the template is rewritten.
Workflows calling tools missing on the target
A workflow that calls an external tool or plugin fails on the new instance if that plugin is not installed or is at a different version. The failure can stay hidden until a specific branch runs. Export a list of every tool and plugin referenced by each app, install the same versions on the target, and run each branch with a test input. Confirm any tool that calls an internal system can reach it from the self-hosted network.
Retrieval changing after re-indexing
Re-uploading documents on the target means re-chunking and re-embedding them, which can differ from the source if chunk size, separators, embedding model or retrieval settings are not copied exactly. Answers shift even though the content is identical. Record the chunk and retrieval settings for each knowledge base, reproduce them on the target, and compare retrieval results for a fixed question set before and after.
Cutting over without freezing the source
If users keep editing apps and documents on the source during migration, the export and the target drift apart and the last changes are lost at cutover. Set a freeze window in which no apps, prompts or knowledge bases change on the source. Take a final export, run the import and checks, and only then redirect users. Keep the source read-only for a defined period so you can roll back.
Which parts of a Dify migration teams keep and which they outsource
This table compares, for each part of a Dify migration, whether the client team usually keeps the work, whether a partner usually takes it, and which skills it needs. Use it to split the work before scoping, since the parts that depend on your own data, credentials and business owners are the ones most often kept in-house even when the rest is outsourced.
| Work part | Client team usually keeps it | Partner usually takes it | Skills needed |
|---|---|---|---|
| App inventory | Yes, owners and business purpose | Yes, listing apps, models and dependencies | Dify app design, business ownership |
| DSL export and import | Yes, exporting from Dify Cloud and approving | Yes, running imports and fixing config drift | Dify administration, YAML handling |
| Knowledge base rebuild | Yes, sourcing and approving source documents | Yes, re-ingesting content and tuning retrieval | Document processing, retrieval tuning |
| Prompt and flow porting from other tools | Yes, confirming intended behavior | Yes, translating logic into Dify workflows | Prompt engineering, workflow design |
| Credential handling | Yes, issuing and approving API keys | Partly, storing keys in the new environment | Secrets handling, identity administration |
| Cutover testing | Yes, acceptance against business cases | Yes, test plans and regression runs | QA, test automation, Dify app testing |
| Documentation for the new environment | Yes, runbooks and ownership records | Yes, drafting architecture and operations notes | Technical writing, security documentation |
What the client must provide before a migration starts
The first input is read access to the source. For a Dify Cloud migration, that means an account with access to the source workspace so the team can export each app as a YAML DSL file, along with a list of which apps exist, who built them and which workflows are live. For other LLM tools, the client needs whatever exports that tool offers, plus screenshots or copies of prompts and flow definitions where exports are incomplete. Confirm early which format each source produces, because DSL exports carry app configuration, workflow nodes, model parameters, prompts and knowledge base connections, but not third-party API keys, knowledge base content or usage logs. Those gaps must be planned for, not discovered during cutover.
The second group of inputs covers credentials and source material. Provide a complete list of model providers in use, the account or project each key belongs to, and where each key is currently held. DeployOpen does not hold the client's third-party keys, so the client must rotate or re-issue them and enter them into the target environment through its own process. Provide the source documents behind every knowledge base, the named owner of each document set, and confirmation that the owner may supply the files again, since knowledge base content must be rebuilt in the target Dify. Also name one owner for each app and one owner for credentials, with authority to approve changes and sign off on testing.
Finally, the client must decide scope and timing. Agree which apps move, which are rebuilt in a different form and which are retired, and record that list in writing before work starts. Confirm the target self-hosted Dify environment is provisioned and reachable, including the chosen deployment method and the metadata database, file storage and vector store it uses. Set a change freeze window on the source apps so prompts and flows do not change mid-migration, and agree who may approve an exception. Ask the team to confirm how long the freeze must last for their own user acceptance testing, since that period is set by their governance rules, not by the migration itself.
Questions buyers ask about Dify migration
Does a Dify DSL export include knowledge base content?
No. According to the Dify docs, a YAML DSL export covers app configuration, workflow nodes, model parameters, prompts and knowledge base connections, but not the documents or chunks inside the knowledge bases. The knowledge base connection is carried over, while the content is not, so each knowledge base must be recreated on the new instance and its source documents re-uploaded or re-synced. The effort depends on how many knowledge bases exist, how many documents each holds, and whether the original files are still available from their source systems. Ask for an inventory of knowledge bases, document counts and source locations before scoping the work. The Dify app management docs describe the export and import process in more detail.
Do API keys and model credentials transfer during a Dify migration?
No. The Dify docs state that exports exclude third-party API keys, so every model provider credential, tool credential and external integration secret must be entered again on the self-hosted instance. This is a planning item rather than a technical obstacle, but it needs an owner. Collect the list of providers and tools each app uses, confirm who holds the keys in each provider account, and rotate any key that was shared or stored outside a secrets manager. Plan the re-entry before cutover so apps do not fail on their first production request.
Can our own team migrate Dify apps without a partner?
Yes, for a small number of apps with simple workflows and few knowledge bases. The export and import steps are straightforward, and the team needs solid familiarity with Docker Compose, the model providers in use and the vector store chosen for knowledge bases. Work grows quickly when apps depend on custom tools, code nodes, environment-specific variables or large document sets, and when the team also has to build the self-hosted platform, identity integration and backups. Compare the internal effort with the scope of a fixed-scope engagement, which DeployOpen agrees in writing before work starts.
How does migration effort grow with app count and document volume?
Effort grows mainly with three factors: the number of apps, the complexity of each workflow, and the volume and format of the documents in each knowledge base. Each app needs a DSL import, a check of its prompts, nodes and model settings, and a test run. Knowledge bases add the most variable work, since re-ingesting many large or messy documents takes longer than re-creating a handful of clean ones. Ask any partner to break the quote down by app, knowledge base and integration, and to state which items are one-time and which recur after go-live.
Can prompts from other LLM tools be imported into Dify directly?
Usually not as a file import. Dify's import format is its own YAML DSL, so prompts, flows and tool calls from other tools must be mapped into Dify's app types, workflow nodes and model settings by hand or with a conversion script. Prompt text is portable, but the surrounding logic, variables, retrieval settings and tool definitions differ between platforms and need rebuilding and testing. Inventory the source tool's prompts, chaining logic and integrations first, then decide which items to recreate and which to retire.
What must our team provide before a Dify migration starts?
Provide access and decisions, not just a list of apps. The useful inputs are the export or source access for each app, the source documents for each knowledge base, the list of model providers and their accounts, the identity provider and admin contacts, the target infrastructure and its access rules, and the people who approve test results. Also state which apps are in production, which are in pilot, and which can be retired. Confirm these items in writing, because missing inputs are the most common cause of delay in a fixed-scope project.
What should we check after cutover to a self-hosted Dify?
Check that each app returns expected answers on real test inputs, that every knowledge base retrieves the right passages, and that all model credentials and tool connections work from the new environment. Confirm that the SECRET_KEY is set and stored securely, that backups of the database and file storage run and restore successfully, and that outbound requests go through the configured proxy. Review access and audit logging for the admin accounts. Keep the old instance read-only for a defined period so the team can compare outputs and roll back if needed.
How DeployOpen scopes, delivers and hands over a Dify migration
DeployOpen plans a Dify migration from Dify Cloud or other LLM tools as a written, fixed-scope project inside your own infrastructure. The work separates what Dify can export, such as YAML DSL app files, from what must be rebuilt or re-entered, such as knowledge base documents and third-party API keys, and documents each step so your team can review it.
How we scope
- Inventory every Dify Cloud app, workflow and knowledge base, and record which ones move as YAML DSL and which must be rebuilt.
- Confirm the target deployment, database, object storage and vector store before any import begins.
- Agree in writing which apps, prompts and flows from other LLM tools are in scope, and which are retired.
How we build
- Import DSL files into the self-hosted instance, then review model parameters, prompts and knowledge base links against the source app.
- Rebuild knowledge bases from source documents and re-enter model provider credentials through the secrets process you approve.
- Test each migrated app against agreed sample inputs and record differences from the original behavior.
How we hand over
- Deliver a migration log listing every app, its source, its import date and any manual changes made during the move.
- Document the rebuilt knowledge bases, credential locations and the backup taken before cutover.
- Walk your platform and application owners through the running system and the runbook for future app changes.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after go-live.
- Retainer scope, response expectations and any service levels should be written into the agreement before work starts.
- Ask for a quote built from the written scope, since DeployOpen does not publish a price list.

