Pulling from GitHub
This page explains how to pull portal configuration from GitHub into Business Central.
What Gets Pulled?
When you pull from GitHub, APD imports:
| Component | Source | Action | |
|---|---|---|---|
| Actions | Tables/Table_APD Action.json |
Replaces all actions | |
| DataItems | Tables/Table_APD Action DataItem*.json |
Replaces configurations | |
| Filters | Tables/Table_APD DataItem Filter 2.json |
Replaces filters | |
| Security Profiles | Tables/Table_APD Security Profile.json |
Replaces profiles | |
| Security Filters | Tables/Table_APD Security Setup.json |
Replaces filters | |
| Content Types | Tables/Table_APD Content Type.json |
Replaces types | |
| Content | `Content/{lang}/*.md | .html` | Replaces content |
| Templates | Templates/* |
Creates/updates templates |
How to Pull
From APD Setup Page
- Open the Advanced Portal Designer menu page (search for it in Tell Me) and click Setup
- Click Pull from GitHub in the action bar
- Confirm when prompted: "Pull everything from branch {branch} in GitHub repository {repo}?"
- Wait for the import to complete
- Actions are automatically compiled after import
Pull Process
When you pull, APD:
- Retrieves the file list from the configured branch
- Downloads and parses each JSON table file
- Deletes existing records in the table
- Imports the new records
- Downloads and imports templates
- Downloads and imports content
- Compiles all actions
Important Warning
⚠️ Pull Replaces Everything
The pull operation replaces existing data:
- All existing actions are deleted first
- All existing security profiles are deleted first
- Templates and content are overwritten
This is destructive! Any local changes not committed to GitHub will be lost.
Before Pulling
Always:
- Commit first if you have local changes you want to keep
- Verify you're pulling from the correct branch
- Understand that local modifications will be lost
Automatic Compilation
After pulling, APD automatically compiles all actions:
- Template references are validated
- Action configurations are verified
- Errors appear in the compilation log
If compilation fails:
- Check the action list for errors
- Review template names for typos
- Verify all referenced templates exist
Use Cases
Synchronizing Environments
Pull to update an environment:
1. Commit from Sandbox to GitHub (develop branch)
2. Merge develop to main in GitHub
3. Pull from GitHub (main branch) to Production
Restoring from Backup
If you need to restore:
- Identify the commit to restore from
- Create a branch from that commit (in GitHub)
- Configure APD to use that branch
- Pull to restore the configuration
Setting Up New Environment
For a fresh environment:
- Install APD
- Configure GitHub settings
- Pull to import all configuration
- Review and test
Handling Conflicts
Local Changes vs GitHub
If you have uncommitted local changes:
| Scenario | Recommendation |
|---|---|
| Keep local | Commit before pulling |
| Discard local | Pull will overwrite |
| Merge manually | Commit first, then review in GitHub |
Template Not Found After Pull
If actions fail to compile due to missing templates:
- Check the
Templates/folder in GitHub - Verify template names match exactly
- Check for language folder structure
Pull Behavior Details
Tables
For each table JSON file:
- Parse the JSON structure
- Delete all existing records in the table
- Insert records from JSON
- Field values are mapped by field number
Templates
For each template file:
- Check if template exists by name (and language)
- Create if new, update if exists
- Template name = filename (no extension)
- Language = subfolder name (empty for default)
Content
For each content file:
- Parse the path:
Content/{language}/{name}.{ext} - Create or update content record
- Determine style from extension (.md = Markdown, .html = HTML)
- Import the text content
Error Handling
"GitHub Account Name or Repository does not seem to be correct"
Verify configuration:
- Check GitHub Account Name matches your username/org
- Check Repository name is correct (without owner prefix)
- Ensure you have access to the repository
"GitHub Connection failed"
Network or authentication issue:
- Check internet connectivity
- Verify token is valid
- Check GitHub status
Compilation Errors After Pull
If actions fail to compile:
- From the Advanced Portal Designer menu page click Actions
- Look for actions with errors
- Use the action's Compile action to see the error detail
- Verify template references
Best Practices
Test in Sandbox First
Before pulling to production:
- Pull to sandbox environment
- Test all portal functionality
- Verify actions compile correctly
- Then pull to production
Backup Before Pull
Consider exporting current state:
- Commit current configuration first
- Then pull new changes
- This creates a recovery point
Verify Branch
Double-check you're pulling from the correct branch:
developfor development workmainfor production-ready configuration
What's NOT Pulled
These items are not affected by pull:
| Item | Reason |
|---|---|
| User records | Not stored in GitHub |
| Session data | Transient |
| License info | Environment-specific |
| Setup configuration | Local settings |
| GitHub settings | Configuration stays |