-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
655 lines (571 loc) · 19.5 KB
/
main.go
File metadata and controls
655 lines (571 loc) · 19.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
// github-forgejo-mirror - Automated GitHub to Forgejo repository mirroring tool
// Author: HRA42 Team
// License: MIT
package main
import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
"time"
"github.com/google/go-github/v57/github"
"golang.org/x/oauth2"
)
const (
version = "1.0.0"
userAgent = "github-forgejo-mirror/" + version
)
// Config holds all configuration parameters
type Config struct {
GitHubToken string
GitHubUser string
GitHubOrg string
ForgejoURL string
ForgejoToken string
ForgejoUser string
Organization string
MirrorInterval string
IncludePrivate bool
IncludeForks bool
DryRun bool
CleanupOrphans bool
Recreate bool
Concurrent int
Verbose bool
OnlyRepos []string
ExcludeRepos []string
}
// GitHubRepo represents a GitHub repository
type GitHubRepo struct {
Name string `json:"name"`
FullName string `json:"full_name"`
Description string `json:"description"`
CloneURL string `json:"clone_url"`
Private bool `json:"private"`
Fork bool `json:"fork"`
Language string `json:"language"`
Stars int `json:"stargazers_count"`
UpdatedAt string `json:"updated_at"`
}
// ForgejoMigrationRequest represents a Forgejo migration API request
type ForgejoMigrationRequest struct {
CloneAddr string `json:"clone_addr"`
RepoName string `json:"repo_name"`
RepoOwner string `json:"repo_owner,omitempty"`
Description string `json:"description"`
Private bool `json:"private"`
Mirror bool `json:"mirror"`
Service string `json:"service"`
MirrorInterval string `json:"mirror_interval,omitempty"`
AuthToken string `json:"auth_token,omitempty"`
AuthPassword string `json:"auth_password,omitempty"`
AuthUsername string `json:"auth_username,omitempty"`
Issues bool `json:"issues"`
PullRequests bool `json:"pull_requests"`
Releases bool `json:"releases"`
Wiki bool `json:"wiki"`
Milestones bool `json:"milestones"`
Labels bool `json:"labels"`
}
// ForgejoRepo represents a Forgejo repository
type ForgejoRepo struct {
ID int `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name"`
Mirror bool `json:"mirror"`
}
// Client wraps HTTP client with custom methods
type Client struct {
httpClient *http.Client
config *Config
}
// NewClient creates a new HTTP client with custom configuration
func NewClient(config *Config) *Client {
return &Client{
httpClient: &http.Client{
Timeout: 30 * time.Second,
},
config: config,
}
}
// GetGitHubRepos fetches all repositories for a user
func (c *Client) GetGitHubRepos(ctx context.Context) ([]*GitHubRepo, error) {
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: c.config.GitHubToken})
tc := oauth2.NewClient(ctx, ts)
client := github.NewClient(tc)
client.UserAgent = userAgent
var allRepos []*github.Repository
if c.config.GitHubOrg != "" {
opts := &github.RepositoryListByOrgOptions{
Type: "all",
Sort: "updated",
Direction: "desc",
ListOptions: github.ListOptions{PerPage: 100},
}
for {
repos, resp, err := client.Repositories.ListByOrg(ctx, c.config.GitHubOrg, opts)
if err != nil {
return nil, fmt.Errorf("failed to fetch GitHub org repos: %w", err)
}
allRepos = append(allRepos, repos...)
if resp.NextPage == 0 {
break
}
opts.Page = resp.NextPage
}
} else {
opts := &github.RepositoryListOptions{
Type: "owner",
Sort: "updated",
Direction: "desc",
ListOptions: github.ListOptions{PerPage: 100},
}
for {
repos, resp, err := client.Repositories.List(ctx, "", opts)
if err != nil {
return nil, fmt.Errorf("failed to fetch GitHub repos: %w", err)
}
allRepos = append(allRepos, repos...)
if resp.NextPage == 0 {
break
}
opts.Page = resp.NextPage
}
}
var result []*GitHubRepo
for _, repo := range allRepos {
// Apply filters
if !c.config.IncludeForks && repo.GetFork() {
continue
}
if !c.config.IncludePrivate && repo.GetPrivate() {
continue
}
if c.shouldSkipRepo(repo.GetName()) {
continue
}
result = append(result, &GitHubRepo{
Name: repo.GetName(),
FullName: repo.GetFullName(),
Description: repo.GetDescription(),
CloneURL: repo.GetCloneURL(),
Private: repo.GetPrivate(),
Fork: repo.GetFork(),
Language: repo.GetLanguage(),
Stars: repo.GetStargazersCount(),
UpdatedAt: repo.GetUpdatedAt().Format(time.RFC3339),
})
}
return result, nil
}
// GetForgejoRepos fetches all repositories from Forgejo
func (c *Client) GetForgejoRepos(ctx context.Context) ([]*ForgejoRepo, error) {
url := fmt.Sprintf("%s/api/v1/user/repos?limit=100", c.config.ForgejoURL)
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "token "+c.config.ForgejoToken)
req.Header.Set("User-Agent", userAgent)
resp, err := c.httpClient.Do(req)
if err != nil {
return nil, fmt.Errorf("failed to fetch Forgejo repos: %w", err)
}
defer resp.Body.Close()
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read response body: %w", err)
}
if c.config.Verbose && len(bodyBytes) > 0 {
fmt.Printf("📋 GetForgejoRepos response (status %d):\n", resp.StatusCode)
// Try to pretty print JSON if possible
var prettyJSON bytes.Buffer
if err := json.Indent(&prettyJSON, bodyBytes, " ", " "); err == nil {
fmt.Printf(" %s\n", prettyJSON.String())
} else {
fmt.Printf(" %s\n", string(bodyBytes))
}
}
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("Forgejo API returned status %d: %s", resp.StatusCode, string(bodyBytes))
}
var repos []*ForgejoRepo
if err := json.Unmarshal(bodyBytes, &repos); err != nil {
return nil, fmt.Errorf("failed to decode Forgejo repos: %w", err)
}
return repos, nil
}
// MigrateRepo creates a mirrored repository in Forgejo
func (c *Client) MigrateRepo(ctx context.Context, repo *GitHubRepo) error {
if c.config.DryRun {
if c.config.Recreate {
fmt.Printf("[DRY RUN] Would delete and recreate: %s\n", repo.Name)
} else {
fmt.Printf("[DRY RUN] Would migrate: %s\n", repo.Name)
}
return nil
}
// If recreate flag is set, delete the repository first
if c.config.Recreate {
if err := c.DeleteRepo(ctx, repo.Name); err != nil {
// Log the error but continue with migration
if c.config.Verbose {
fmt.Printf("⚠️ Failed to delete %s: %v (continuing with migration)\n", repo.Name, err)
}
}
// Add a small delay to ensure deletion is processed
time.Sleep(500 * time.Millisecond)
}
migration := &ForgejoMigrationRequest{
CloneAddr: repo.CloneURL,
RepoName: repo.Name,
RepoOwner: c.config.ForgejoUser,
Description: repo.Description,
Private: repo.Private,
Mirror: true,
Service: "github",
MirrorInterval: c.config.MirrorInterval,
AuthToken: c.config.GitHubToken,
AuthPassword: c.config.GitHubToken,
AuthUsername: c.config.GitHubUser,
Issues: true,
PullRequests: true,
Releases: true,
Wiki: true,
Milestones: true,
Labels: true,
}
// Override owner if organization is specified
if c.config.Organization != "" {
migration.RepoOwner = c.config.Organization
}
body, err := json.Marshal(migration)
if err != nil {
return fmt.Errorf("failed to marshal migration request: %w", err)
}
if c.config.Verbose {
fmt.Printf("📤 Migration request for %s:\n", repo.Name)
// Pretty print the request body
var prettyJSON bytes.Buffer
if err := json.Indent(&prettyJSON, body, " ", " "); err == nil {
fmt.Printf(" %s\n", prettyJSON.String())
} else {
fmt.Printf(" %s\n", string(body))
}
}
url := fmt.Sprintf("%s/api/v1/repos/migrate", c.config.ForgejoURL)
req, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewReader(body))
if err != nil {
return err
}
req.Header.Set("Authorization", "token "+c.config.ForgejoToken)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("User-Agent", userAgent)
resp, err := c.httpClient.Do(req)
if err != nil {
return fmt.Errorf("failed to migrate repository: %w", err)
}
defer resp.Body.Close()
// Read response body for verbose logging or error details
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil && c.config.Verbose {
fmt.Printf("⚠️ Failed to read response body: %v\n", err)
}
if c.config.Verbose && len(bodyBytes) > 0 {
fmt.Printf("📋 Response from Forgejo (status %d):\n", resp.StatusCode)
// Try to pretty print JSON if possible
var prettyJSON bytes.Buffer
if err := json.Indent(&prettyJSON, bodyBytes, " ", " "); err == nil {
fmt.Printf(" %s\n", prettyJSON.String())
} else {
fmt.Printf(" %s\n", string(bodyBytes))
}
}
if resp.StatusCode == http.StatusCreated {
if c.config.Recreate {
fmt.Printf("✅ Successfully recreated: %s\n", repo.Name)
} else {
fmt.Printf("✅ Successfully migrated: %s\n", repo.Name)
}
return nil
} else if resp.StatusCode == http.StatusConflict {
if !c.config.Recreate {
fmt.Printf("⚠️ Repository already exists: %s\n", repo.Name)
return nil
}
// If recreate was enabled but we still get conflict, it's an error
return fmt.Errorf("repository still exists after deletion: %s", repo.Name)
}
// Include response body in error for non-verbose mode if there's an error
if !c.config.Verbose && len(bodyBytes) > 0 {
return fmt.Errorf("migration failed with status %d for repo %s: %s", resp.StatusCode, repo.Name, string(bodyBytes))
}
return fmt.Errorf("migration failed with status %d for repo %s", resp.StatusCode, repo.Name)
}
// DeleteRepo deletes a repository from Forgejo
func (c *Client) DeleteRepo(ctx context.Context, repoName string) error {
if c.config.DryRun {
fmt.Printf("[DRY RUN] Would delete repository: %s\n", repoName)
return nil
}
owner := c.config.ForgejoUser
if c.config.Organization != "" {
owner = c.config.Organization
}
url := fmt.Sprintf("%s/api/v1/repos/%s/%s", c.config.ForgejoURL, owner, repoName)
req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil)
if err != nil {
return err
}
req.Header.Set("Authorization", "token "+c.config.ForgejoToken)
req.Header.Set("User-Agent", userAgent)
resp, err := c.httpClient.Do(req)
if err != nil {
return fmt.Errorf("failed to delete repository: %w", err)
}
defer resp.Body.Close()
// Read response body for verbose logging
if c.config.Verbose {
bodyBytes, err := io.ReadAll(resp.Body)
if err == nil && len(bodyBytes) > 0 {
fmt.Printf("📋 Delete response from Forgejo (status %d):\n", resp.StatusCode)
fmt.Printf(" %s\n", string(bodyBytes))
}
}
if resp.StatusCode == http.StatusNoContent || resp.StatusCode == http.StatusOK {
fmt.Printf("🗑️ Deleted repository: %s\n", repoName)
return nil
} else if resp.StatusCode == http.StatusNotFound {
// Repository doesn't exist, which is fine for our use case
return nil
}
return fmt.Errorf("delete failed with status %d for repo %s", resp.StatusCode, repoName)
}
// SyncMirror triggers a sync for an existing mirror
func (c *Client) SyncMirror(ctx context.Context, repoName string) error {
if c.config.DryRun {
fmt.Printf("[DRY RUN] Would sync mirror: %s\n", repoName)
return nil
}
owner := c.config.ForgejoUser
if c.config.Organization != "" {
owner = c.config.Organization
}
url := fmt.Sprintf("%s/api/v1/repos/%s/%s/mirror-sync", c.config.ForgejoURL, owner, repoName)
req, err := http.NewRequestWithContext(ctx, "POST", url, nil)
if err != nil {
return err
}
req.Header.Set("Authorization", "token "+c.config.ForgejoToken)
req.Header.Set("User-Agent", userAgent)
resp, err := c.httpClient.Do(req)
if err != nil {
return fmt.Errorf("failed to sync mirror: %w", err)
}
defer resp.Body.Close()
// Read response body for verbose logging
if c.config.Verbose {
bodyBytes, err := io.ReadAll(resp.Body)
if err == nil && len(bodyBytes) > 0 {
fmt.Printf("📋 Sync response from Forgejo (status %d):\n", resp.StatusCode)
fmt.Printf(" %s\n", string(bodyBytes))
}
}
if resp.StatusCode == http.StatusOK {
fmt.Printf("🔄 Sync triggered for: %s\n", repoName)
return nil
}
return fmt.Errorf("sync failed with status %d for repo %s", resp.StatusCode, repoName)
}
// shouldSkipRepo checks if a repository should be skipped based on filters
func (c *Client) shouldSkipRepo(repoName string) bool {
// If only specific repos are requested
if len(c.config.OnlyRepos) > 0 {
for _, name := range c.config.OnlyRepos {
if name == repoName {
return false
}
}
return true
}
// If repo is in exclude list
for _, name := range c.config.ExcludeRepos {
if name == repoName {
return true
}
}
return false
}
// parseStringSlice parses a comma-separated string into a slice
func parseStringSlice(s string) []string {
if s == "" {
return nil
}
parts := strings.Split(s, ",")
var result []string
for _, part := range parts {
if trimmed := strings.TrimSpace(part); trimmed != "" {
result = append(result, trimmed)
}
}
return result
}
// loadConfig loads configuration from environment variables and flags
func loadConfig() *Config {
config := &Config{}
// Command line flags
flag.StringVar(&config.GitHubToken, "github-token", os.Getenv("GITHUB_TOKEN"), "GitHub personal access token")
flag.StringVar(&config.GitHubUser, "github-user", os.Getenv("GITHUB_USER"), "GitHub username")
flag.StringVar(&config.GitHubOrg, "github-org", os.Getenv("GITHUB_ORG"), "GitHub organization (optional, lists org repos instead of user repos)")
flag.StringVar(&config.ForgejoURL, "forgejo-url", os.Getenv("FORGEJO_URL"), "Forgejo instance URL")
flag.StringVar(&config.ForgejoToken, "forgejo-token", os.Getenv("FORGEJO_TOKEN"), "Forgejo access token")
flag.StringVar(&config.ForgejoUser, "forgejo-user", os.Getenv("FORGEJO_USER"), "Forgejo username")
flag.StringVar(&config.Organization, "organization", os.Getenv("FORGEJO_ORG"), "Forgejo organization (optional)")
flag.StringVar(&config.MirrorInterval, "mirror-interval", os.Getenv("MIRROR_INTERVAL"), "Mirror sync interval (e.g., '10m', '1h', '24h'). Empty for default.")
flag.BoolVar(&config.IncludePrivate, "include-private", os.Getenv("INCLUDE_PRIVATE") == "true", "Include private repositories")
flag.BoolVar(&config.IncludeForks, "include-forks", os.Getenv("INCLUDE_FORKS") == "true", "Include forked repositories")
flag.BoolVar(&config.DryRun, "dry-run", false, "Show what would be done without making changes")
flag.BoolVar(&config.CleanupOrphans, "cleanup", false, "Remove mirrors that no longer exist on GitHub")
flag.BoolVar(&config.Recreate, "recreate", os.Getenv("RECREATE_REPOS") == "true", "Delete and recreate existing repositories")
flag.IntVar(&config.Concurrent, "concurrent", 3, "Number of concurrent migrations")
flag.BoolVar(&config.Verbose, "verbose", false, "Enable verbose logging")
var onlyRepos, excludeRepos string
flag.StringVar(&onlyRepos, "only", os.Getenv("ONLY_REPOS"), "Comma-separated list of repos to migrate (migrate only these)")
flag.StringVar(&excludeRepos, "exclude", os.Getenv("EXCLUDE_REPOS"), "Comma-separated list of repos to exclude")
var showVersion bool
flag.BoolVar(&showVersion, "version", false, "Show version and exit")
flag.Parse()
if showVersion {
fmt.Printf("github-forgejo-mirror version %s\n", version)
os.Exit(0)
}
config.OnlyRepos = parseStringSlice(onlyRepos)
config.ExcludeRepos = parseStringSlice(excludeRepos)
// Validation
if config.GitHubToken == "" {
log.Fatal("GitHub token is required (--github-token or GITHUB_TOKEN)")
}
if config.GitHubUser == "" {
log.Fatal("GitHub username is required (--github-user or GITHUB_USER)")
}
if config.ForgejoURL == "" {
log.Fatal("Forgejo URL is required (--forgejo-url or FORGEJO_URL)")
}
if config.ForgejoToken == "" {
log.Fatal("Forgejo token is required (--forgejo-token or FORGEJO_TOKEN)")
}
if config.ForgejoUser == "" && config.Organization == "" {
log.Fatal("Either Forgejo user or organization is required")
}
// Clean up Forgejo URL
config.ForgejoURL = strings.TrimSuffix(config.ForgejoURL, "/")
return config
}
// printStats prints migration statistics
func printStats(total, migrated, skipped, failed int, duration time.Duration) {
fmt.Printf("\n📊 Migration Summary:\n")
fmt.Printf(" Total repos: %d\n", total)
fmt.Printf(" Migrated: %d\n", migrated)
fmt.Printf(" Skipped: %d\n", skipped)
fmt.Printf(" Failed: %d\n", failed)
fmt.Printf(" Duration: %v\n", duration.Round(time.Second))
}
func main() {
config := loadConfig()
client := NewClient(config)
ctx := context.Background()
startTime := time.Now()
fmt.Printf("🚀 GitHub to Forgejo Mirror Tool v%s\n", version)
if config.GitHubOrg != "" {
fmt.Printf(" Source: %s (org) @github.com\n", config.GitHubOrg)
} else {
fmt.Printf(" Source: %s@github.com\n", config.GitHubUser)
}
fmt.Printf(" Target: %s\n", config.ForgejoURL)
if config.DryRun {
fmt.Printf(" Mode: DRY RUN\n")
}
if config.Recreate {
fmt.Printf(" Mode: RECREATE (will delete existing repos)\n")
}
fmt.Println()
// Fetch GitHub repositories
fmt.Println("📡 Fetching GitHub repositories...")
githubRepos, err := client.GetGitHubRepos(ctx)
if err != nil {
log.Fatalf("Failed to fetch GitHub repositories: %v", err)
}
fmt.Printf(" Found %d repositories on GitHub\n", len(githubRepos))
// Optionally fetch existing Forgejo repos for cleanup
var forgejoRepos []*ForgejoRepo
if config.CleanupOrphans {
fmt.Println("📡 Fetching Forgejo repositories for cleanup...")
forgejoRepos, err = client.GetForgejoRepos(ctx)
if err != nil {
log.Printf("Warning: Failed to fetch Forgejo repos for cleanup: %v", err)
} else {
fmt.Printf(" Found %d repositories on Forgejo\n", len(forgejoRepos))
}
}
// Create a semaphore for concurrent operations
semaphore := make(chan struct{}, config.Concurrent)
results := make(chan string, len(githubRepos))
var migrated, skipped, failed int
// Process each repository
fmt.Println("\n🔄 Starting migration...")
for _, repo := range githubRepos {
go func(r *GitHubRepo) {
semaphore <- struct{}{} // Acquire
defer func() { <-semaphore }() // Release
if config.Verbose {
fmt.Printf("🔍 Processing: %s (⭐%d, %s)\n", r.Name, r.Stars, r.Language)
}
if err := client.MigrateRepo(ctx, r); err != nil {
results <- fmt.Sprintf("❌ Failed to migrate %s: %v", r.Name, err)
return
}
results <- "success"
}(repo)
}
// Collect results
for i := 0; i < len(githubRepos); i++ {
result := <-results
if result == "success" {
migrated++
} else if strings.Contains(result, "already exists") {
skipped++
} else {
failed++
if config.Verbose {
fmt.Println(result)
}
}
}
// Cleanup orphaned mirrors
if config.CleanupOrphans && len(forgejoRepos) > 0 {
fmt.Println("\n🧹 Cleaning up orphaned mirrors...")
githubNames := make(map[string]bool)
for _, repo := range githubRepos {
githubNames[repo.Name] = true
}
for _, forgejoRepo := range forgejoRepos {
if forgejoRepo.Mirror && !githubNames[forgejoRepo.Name] {
fmt.Printf("🗑️ Found orphaned mirror: %s\n", forgejoRepo.Name)
// Note: Deletion would require additional API call
}
}
}
duration := time.Since(startTime)
printStats(len(githubRepos), migrated, skipped, failed, duration)
if failed > 0 {
fmt.Printf("\n⚠️ %d repositories failed to migrate. Check logs for details.\n", failed)
os.Exit(1)
}
fmt.Println("\n🎉 Migration completed successfully!")
}