timescale / timescaledb-backup

Other
33 stars 9 forks source link

module declares its path as: github.com/timescale/ts-dump-restore #29

Closed mccarthysean closed 3 years ago

mccarthysean commented 3 years ago

I can't seem to get this to install correctly. I've never used Golang before, but this is what I get when I try to install it in Alpine Linux v3.12.3 (in the golang:rc-alpine Docker container):

go get -u github.com/timescale/timescaledb-backup/

go: downloading github.com/timescale/timescaledb-backup v0.0.0-20210107191149-ff6031c44f8b
go get: github.com/timescale/timescaledb-backup@none updating to
        github.com/timescale/timescaledb-backup@v0.0.0-20210107191149-ff6031c44f8b: parsing go.mod:
        module declares its path as: github.com/timescale/ts-dump-restore
                but was required as: github.com/timescale/timescaledb-backup

After that I type which ts-dump and nothing is returned... Not sure how to issue a command at that point... Did the installation fail? I'm not sure... I have packages that seemed to install here: /go/pkg/mod/github.com/timescale/timescaledb-backup@v0.0.0-20210107191149-ff6031c44f8b

In the above directory, the go.mod file references ts-dump-restore as follows:

module github.com/timescale/ts-dump-restore

go 1.14

require (
        github.com/docker/go-connections v0.4.0
        github.com/jackc/pgconn v1.5.0
        github.com/jackc/pgx/v4 v4.6.0
        github.com/testcontainers/testcontainers-go v0.3.1
)

Thanks a lot! I'm trying to build a Docker image that will automatically backup TimescaleDB and upload to S3, but I've been having issues with pg_restore so I'd like to use this timescaledb-backup instead. See my repo here.

Sean

mccarthysean commented 3 years ago

FYI, this is how I fixed the installation error, in a Docker container:

# Download and build the ts-dump and ts-restore Golang packages
RUN go get -u github.com/timescale/timescaledb-backup/ || true && \
    # cd to the download directory
    cd /go/pkg/mod/github.com/timescale/timescaledb-backup@v0.0.0-20210107191149-ff6031c44f8b && \
    # Replace ts-dump-restore reference with timescaledb-backup in the go.mod file
    sed -i 's/github.com\/timescale\/ts-dump-restore/github.com\/timescale\/timescaledb-backup/g' go.mod && \
    # Build ts-dump first
    cd cmd/ts-dump && \
    go mod tidy && \
    go build -o /usr/local/go/bin/ts-dump && \
    # Build ts-restore second
    cd ../ts-restore && \
    go mod tidy && \
    go build -o /usr/local/go/bin/ts-restore

Here's a pull request I submitted, to fix the issue in the master branch: https://github.com/timescale/timescaledb-backup/pull/30

Sean