Background

When converting PowerBuilder 2025 applications from workspace format to solution format, users need to disable source control and create a new repository.


Resolution

For users who need to preserve their source control history, this article provides the following approaches:

Manual approach:

Automated approach (using a batch file):

Please refer to the section that best fits your scenario.


Steps to preserve history when converting workspace to solution

If the PBL files have already been uploaded to source control, they must be deleted first and the deletion must be committed to the source control server.
 

  • Steps for SVN

In PowerBuilder 2025 IDE, right-click on the System Tree, click Connect to Workspace to connect to the application on SVN that you want to convert to solution, and pull the latest version to your local directory.


Step 1 – Disable SVN source control

Right-click on the root node of System Tree and select Properties. Open the Properties of Workspace window and go to the Source Control tab. Change Source Control System from Subversion(SVN) to (None) and click the OK button.

change SVN to None


Step 2 – Convert to solution

Right click on the workspace of the application and select Convert Workspace to Solution, and then wait for the conversion to complete. 

convert workspace to solution


Step 3 – Back up the PBL folders

Once the conversion is complete, the solution will open automatically in the PowerBuilder IDE. Right-click the root node of the solution and select Open Containing Folder. In the opened directory, locate all folders with names ending in .pbl and move them to a safe location for backup.

locate pbl

backup pbl


Step 4 – Open the _BackupFiles folder. Move the .svn and ws_objects folders to the parent directory.

move svn and ws_objects folders


Step 5 – Rename the .pbl.src folders using the SVN client

Open the ws_objects folder, locate all folders with names ending in .pbl.src, and use your SVN client (for example, via the right-click menu) to change them all from .pbl.src to .pbl.

rename .pbl.src to .pbl


Remove .src from the folder name:

remove .src


After completing this step, use your SVN client to commit the changes to the server.

If you encounter the following error when committing, it indicates that the objects are not up to date. Please perform an update using your SVN client before committing again.

not up to date SVN error


Step 6 – Overwrite the files in the *.pbl folders

Overwrite the files in each *.pbl folder with the files in the corresponding .pbl folder that you have backed up in Step 3, and then perform Commit with your SVN client.

Overwrite files in PBL


Step 7 – Move all *.pbl folders to the parent directory using the SVN client (Key Step)

Select all *.pbl folders in the ws_objects directory, then right-click and drag them to the parent directory. From the popped-up context menu, select “SVN move versioned item(s) here”.

move all pbl folders with svn client

SVN move versioned items here


Select *.pbl and ws_objects folders and commit the changes using the SVN client.

commit the changes using the SVN client


If you encounter the following error when committing, it indicates that the objects are not up to date. Please perform an update using your SVN client before committing again.

not up to date SVN error2


Step 8 – Enable SVN source control

Open the solution in PowerBuilder IDE. Right-click on the solution and open the Properties of Solution window. On the Source Control tab, change Source Control System from (None) to Subversion(SVN).

change none to svn


Right -click on the solution on the System Tree and perform commit.

final svn commit


Step 9 – Check the history

Right-click on the solution and open the Properties of Solution window. On the Source Control tab, click the Advanced button to configure Show Log/Edit Conflicts.

configure Show LogEdit Conflicts

svn show log


Now you can check the log of each object. You should be able to view the history log after de-selecting “Stop on copy/rename”.

svn history log
 

  • Steps for Git

In PowerBuilder 2025 IDE, right-click on the System Tree, click Connect to Workspace to connect to the application on Git that you want to convert to solution, and pull the latest version to your local directory.


Step 1 – Disable Git source control

Right-click on the root node of the System Tree and select Properties. Open the Properties of Workspace window and go to the Source Control tab. Change Source Control System from Git to (None) and click the OK button.

change git to none

Note: This is because a Workspace under source control does not allow the “Convert Workspace to Solution” operation. Therefore, source control must be removed before performing the conversion.


Step 2 – Convert the application to solution

Right click on the root node of the application and select Convert Workspace to Solution, and then wait for the conversion to complete. 

convert workspace to solution2


Step 3 – Back up the PBL folders

Once the conversion is complete, the solution will open automatically in the PowerBuilder IDE. Right-click the solution and select Open Containing Folder. In the opened directory, locate all folders with names ending in .pbl and move them to a safe location for backup.

Open Containing Folder


Step 4 – Copy the .git folder of the original Workspace

Open %ProjectDemo%/_BackupFiles directory. Copy the .git and ws_objects folders to the parent directory, which is the same directory as the new *.pbsln file.

git and ws_objects folders

Reason to copy the .git file: The Git directory contains all the data from adding the original Workspace to the Git repository and preserves the core logs after conversion, including:

  • HEAD: A reference pointing to the latest commit of the current branch.
  • refs/: A directory that stores branch references and tag references.
  • objects/: A directory that stores all objects (blobs, trees, commits, and tags).
  • config: Contains the project’s configuration information, such as remote repository URLs.
  • description: A plain text file used to describe the repository.
  • hooks/: A directory that contains client-side or server-side hook scripts.
  • index: Also known as the staging area cache. It is a binary file that stores snapshot information for the next commit.


Step 5 – Rename the .pbl.src folders using the Git client

Open the ws_objects folder, locate all folders with names ending in .pbl.src, and use your Git client (for example, via the right-click menu) to change them all from .pbl.src to .pbl.

Rename .pbl.src with Git client

Remove .src from the folder name:

remove .src with git

Reason to rename: After converting the PBW to a Solution, the naming convention of the PBL directories changes. The renaming is intended to align the directory names with the Solution.


Step 6 – Overwrite the files in the *.pbl folders

Overwrite the files in each *.pbl folder with the files in the corresponding .pbl folder that you have backed up in Step 1, and then commit with your Git client.

Overwrite files in PBL2

Reason to overwrite the Solution PBL Objects: Under the original PBW approach, the object source code in ws_objects/*.PBL contains the export header $PBExportHeader$w_temp.srw.

Step 7 – Move all *.pbl folders to the parent directory using the Git client (key step)

Select all *.pbl folders in the ws_objects directory, then right-click and drag them to the parent directory. 

move all pbl folders with git client.png


From the popped-up context menu, select “Git Move versioned item(s) here”.

Make sure you have completed each step correctly and then use the Git client to commit all the changes.

Git Move versioned items here.png

Reason to move: Keep the directory structure consistent with the Solution.


Step 8 – Enable Git source control

Open the solution in PowerBuilder IDE. Right-click on the root node of the solution and open the Properties of Solution window. On the Source Control tab, change Source Control System from (None) to Git.

change none to git.png


Right-click on the root node of the solution on the System Tree and commit.

final git commit.png


Step 9 – Pull and Push the solution

After the Solution integrates the source control repository information from the original Workspace, pushing directly results in the following error. You need to right-click the project in the IDE and select Git Pull to update the local version first.
Reason: the working directory is not up to date.

---------- Source Control: Errors   (5:09:45 PM)
Git detail error info: Cannot push because a reference that you are trying to update on the remote contains commits that are not present locally.
Git client error code: Reference was not fast-forwardable. Please execute Git Pull to merge remote changes into your local repository before trying again. 
Failed to push solution.
 ---------- Finished Errors   (5:09:45 PM)
 ---------- Elapsed: 00:00.105

Error pushing git

Note: This workaround will result in the original PBW content remaining in the working directory. In other words, both the Workspace and the Solution project structures will coexist. A visual comparison is shown below:

Workspace Solution visual comparison


Step 10 – Check the history

Right-click on the root node of the solution and open the Properties of Solution window. On the Source Control tab, click the Advanced button to configure Show Log/Edit Conflicts.

Now you can check the log of each object. You should be able to view the history log after setting “Walk Behavior” to “Follow names”.

Walk Behavior follow names


For example, after converting to solution, the “modify object” commit that was made to the w_genapp_toolbars.srw object before converting to solution can still be seen in the source control log.

git history log


 

  • Steps for SVN batch processing

Step 1 – Disable SVN source control

Change Source Control System to (None) and click the OK button. Then convert your application to solution.

SVN Bat change source control to none


Step 2 - Execute the Batch file

Add svn.exe into environment variables first. You can download svn.exe from Download VisualSVN

Then execute the Batch file that contains the following content. Note that you need to modify the svn_work value to your project directory first.

@echo off
rem the directory of your application 
@set svn_work=D:\
setlocal enabledelayedexpansion

rem If the PBL files have already been uploaded to SVN, they must be deleted first and the deletion must be committed to the SVN server.
rem Note that the application should have been converted to solution.
cd /D %svn_work%

rem Move .svn and ws_objects. Make sure the source code record is at the same SVN path as the solution project.
cd /D %svn_work%
PowerShell -C "mv '_BackupFiles\.svn' '%svn_work%' -Force"
move "_BackupFiles\ws_objects" "%svn_work%"
copy "_BackupFiles\*.pbw" "%svn_work%"
copy "_BackupFiles\*.pbt" "%svn_work%"

rem Execute SVN Rename to remove .src so that the solution project can reference the source code repository.
cd /d %svn_work%\ws_objects
echo svn Rename
for /d %%D in (*.pbl.src) do (
set "oldname=%%D"
set "newname=!oldname:.pbl.src=.pbl!"
echo renaming %%D to !newname!
svn rename "%%D" "!newname!"
)
svn commit -m "rename pbl"
echo Rename final
cd / %svn_work%

rem Overwrite the source object with the solution object, as the source object includes an export header and therefore cannot be used directly.
for /d %%E in (*.pbl) do (
move /y "%svn_work%\%%E\*.*" "%svn_work%\ws_objects\%%E\"
)
echo svn replace
svn commit -m "pbl object replace"
echo replace final

rem Delete PBL and move the PBL directory.
cd /d %svn_work%\
for /d %%F in (*.pbl) do (
rd /S /Q "%%F"
)
cd /d %svn_work%\ws_objects
echo svn move
svn update
for /d %%G in (*.pbl) do (
svn move "%%G" "%svn_work%\%%G"
)

rem Delete ws_objects,*.pbw,*.pbt.
cd /d %svn_work%\

svn delete "ws_objects"

for %%H in (*.pbw) do (
svn delete "%%H"
)

for %%J in (*.pbt) do (
svn delete "%%J"
)

svn commit -m "move pbl"
echo move final
pause


Step 3 - Enable SVN source control

Follow the same steps as described earlier. Open the solution in the PowerBuilder IDE. Right-click the solution and select Properties to open the Solution Properties window. On the Source Control tab, change the Source Control System from (None) to Subversion (SVN).


Step 4 - Check History

Try checking the submission history of each object and checking the history record after un-selecting "Stop on copy/rename".

check history after svn bat


 

  • Steps for Git batch processing

Step 1 - Disable Git source control

Right-click on the root node of the System Tree and select Properties. Open the Properties of Workspace window and go to the Source Control tab. Change Source Control System from Git to (None) and click the OK button.


Step 2 – Convert the application to solution

Right click on the root node of the application and select Convert Workspace to Solution, and then wait for the conversion to complete. 

convert workspace to solution2

After the conversion, open the containing folder of the solution project.

Open Containing Folder


Step 3 - Execute the Batch file

Execute the Batch file that contains the following content in Command Prompt. Note that you need to modify the git_work value to your project directory first.

@echo off
rem The directory of your application. 
@set git_work=C:\
setlocal enabledelayedexpansion

rem If the PBL files have already been uploaded to Git, they must be deleted first and the deletion must be committed to the Git server.
rem Note that the application should have been converted to solution.
cd /d %git_work%

rem Move .git and ws_object. Make sure the source code record is at the same Git path as the solution project.
PowerShell -C "mv '_BackupFiles\.git' '%git_work%' -Force"
move "_BackupFiles\ws_objects" "%git_work%"

rem Execute Git Rename to remove .src so that the solution can reference the source code repository.
cd /d %git_work%\ws_objects
echo git Rename
git update-git-for-windows
for /d %%D in (*.pbl.src) do (
set "oldname=%%D"
set "newname=!oldname:.pbl.src=.pbl!"
echo renaming %%D to !newname!
git mv "%%D" "!newname!"
)
git commit -m "rename pbl"
echo Rename final
cd /d %git_work%
rem Overwrite the source object with the solution object, as the source object includes an export header and therefore cannot be used directly.
for /d %%E in (*.pbl) do (
move /y "%git_work%\%%E\*.*" "%git_work%\ws_objects\%%E\"
)
echo git replace
git commit -m "pbl object replace"
echo replace final
rem Delete PBL and move the PBL directory.
cd /d %git_work%\
for /d %%F in (*.pbl) do (
rd /S /Q "%%F"
)
cd /d %git_work%\ws_objects
echo git move
git update-git-for-windows
for /d %%G in (*.pbl) do (
git mv "%%G" "%git_work%\%%G"
)

cd /d %git_work%\
rmdir /s /q ws_objects

git commit -m "move pbl"
echo move final


Step 4 - Enable Git source control

Open the solution in PowerBuilder IDE. Right-click on the root node of the solution and open the Properties of Solution window. On the Source Control tab, change Source Control System from (None) to Git.

Right-click on the root node of the solution on the System Tree and commit.

final git commit.png


Step 5 – Check the history

Right-click on the solution and select "Git Show Log" to check the history records.

 

3
0